当前位置: 首页 > news >正文

网站空间续费一年多少钱少儿编程课是学什么的

网站空间续费一年多少钱,少儿编程课是学什么的,四川住房建设厅网站,爱站网关键词查询网站Codeforces Round #701 (Div. 2)赛后补题报告(A~D) A. Add and Divide 原题信息 http://codeforces.com/contest/1485/problem/A 解题思路 对于题目基本有两种方式#xff0c;一种是直接暴力求解#xff0c;第二种是使用函数求导进行严格证明 暴力求解 a1e9a1e^9a1e9不…Codeforces Round #701 (Div. 2)赛后补题报告(A~D) A. Add and Divide 原题信息 http://codeforces.com/contest/1485/problem/A 解题思路 对于题目基本有两种方式一种是直接暴力求解第二种是使用函数求导进行严格证明 暴力求解 a1e9a1e^9a1e9不难看出操作最多为 50次因为2495629499534213122 ^ 49 562949953421312249562949953421312 直接就超了 那么我们的 bbb最多也就是加50次然后进行向下整除的模拟即可 一定要注意 b0b 0b0这种情况。 函数求导 首先我们设操作次数为yyy进行 b1b 1b1的次数为xxx可以得到的关系式为 yx(logbxa1)y x (log_{bx}a1)yx(logbx​a1)其中logbxalog_{bx}alogbx​a是整除到1的次数最后 1是让其变为0 下面我们对他进行求导 y′1−lna(lnt)2⋅ty1-\frac{ln{a}}{(lnt)^2\cdot t}y′1−(lnt)2⋅tlna​其中tbxt≥2并且t≥btbxt\geq2 并且 t\geq btbxt≥2并且t≥b 查看导函数的零点 (lnt)2⋅tlnat≥2并且t≥b{(lnt)^2\cdot t}lnat\geq2 并且 t\geq b(lnt)2⋅tlnat≥2并且t≥b等式左侧递增右侧为常数lnalnalna即至多有一个零点 倘若有一个零点 可以直接二分求得零点我们在零点零点1 零点-1进行求解得结果。 倘若没有零点 直接就是t≥2并且t≥bt\geq2 并且 t\geq bt≥2并且t≥b取得最小值。 AC代码 首先必须吐嘲一下暴力没往这个向限制求导生疏了整了半天真鸡儿狗 暴力枚举代码 #include bits/stdc.h using namespace std;typedef long long LL; const int N 100010;LL a, b;int sol(LL a, LL b, int add) {b add;if (b 1) return 0x3f3f3f3f;while (a){a / b;add ;}return add; }int main() {int T; cin T;while (T -- ){scanf(%lld%lld, a, b);int res 1000;for (int i 0; i 50; i ){res min(res, sol(a, b, i));}cout res endl;}return 0; } 函数求导代码 #include bits/stdc.h using namespace std;const int N 100010; typedef long long LL; const double esp 1e-5; LL a, b;int RealDo(LL a, LL b) {int ret 0;while (a){ret ;a / b;}return ret; }int Get(LL a, LL b, LL tarb) {if (tarb 1 || tarb b) return 0x3f3f3f3f;// return (tarb - b) floor(log(a) / log(tarb)) 1;return (tarb - b) RealDo(a, tarb); }double Cal(LL a, LL b) {double lga log(a);double l b, r 2e9, mid b;if (lga mid * (log(mid) * log(mid)) ) // 不用加return mid;while (abs(l - r) esp){mid (l r) / 2;if (lga mid * (log(mid) * log(mid))) // 高了r mid;else // 低了l mid;}return mid; }int sol(LL a, LL b) {double x Cal(a, b);return min(Get(a, b, x), min(Get(a, b, x 1), Get(a, b, x - 1))); }int main() {int t;cin t;while (t -- ){scanf(%lld%lld, a, b);cout sol(a, b) endl;}return 0; } B. Replace and Keep Sorted 原题信息 http://codeforces.com/contest/1485/problem/B 解题思路 我们单独考虑端点的可能性已经中间结点不同的次数可以使用前缀和 但是一定要仔细考虑什么时候 1什么时候没有1, 端点是否包括 AC代码 #include bits/stdc.h using namespace std;const int N 100010; int n, k, q; int a[N]; int b[N];int cal(int l, int r) {if (l r) return k - 1;else{int ret (a[l] - 1) (a[l 1] - a[l] - 1) (k - a[r]) (a[r] - a[r - 1] - 1);if (l r - 1)return ret;elsereturn ret b[r - 1] - b[l]; // l 1 ~ r - 1} } int main() {cin n q k;for (int i 1; i n; i )scanf(%d, a[i]);memset(b, 0, sizeof b);for (int i 2; i n - 1; i )b[i] (a[i] - a[i - 1] - 1) (a[i 1] - a[i] - 1);for (int i 2; i n - 1; i )b[i] b[i - 1];while (q -- ){static int l, r;scanf(%d%d, l, r);// cout res endl \t;cout cal(l, r) endl;}return 0; } C. Floor and Mod 原题信息 http://codeforces.com/contest/1485/problem/C 解题思路 C题吐槽一下当时复杂度分析错了O(N)O(\sqrt N)O(N​)分析成O(N)O(N)O(N)太绝了 设⌊ab⌋a%bt,tb\lfloor\frac a b\rfloora\%bt, t b⌊ba​⌋a%bt,tb 那么at⋅bt(b1)⋅t,A≥a≥1,B≥b≥1at \cdot b t(b1)\cdot t, A\geq a\geq1,B\geq b\geq1at⋅bt(b1)⋅t,A≥a≥1,B≥b≥1 当t1t1t1时ab1,b∈[2,B]ab1,b\in [2, B]ab1,b∈[2,B]当t2t2t2时a2⋅(b1),b∈[3,B]a2\cdot(b1),b\in [3, B]a2⋅(b1),b∈[3,B]…当tititi时ai⋅(b1),b∈[i1,B]ai\cdot(b1),b\in [i 1, B]ai⋅(b1),b∈[i1,B] 此时,i⋅(b1)≤A,b≤B,b≥i1i \cdot (b 1)\leq A, b\leq B, b\geq i1i⋅(b1)≤A,b≤B,b≥i1 ⟹b∈[i1,min(B,⌊Ai⌋−1)]\Longrightarrow b\in [i 1, min(B,\lfloor \frac A i \rfloor-1)]⟹b∈[i1,min(B,⌊iA​⌋−1)] 如果⌊Ai⌋−1\lfloor \frac A i \rfloor-1⌊iA​⌋−1有前缀和公式的话是可以进行化简为O(1)O(1)O(1)的 最后b∈[i1,min(B,⌊Ai⌋−1)]b\in [i 1, min(B,\lfloor \frac A i \rfloor-1)]b∈[i1,min(B,⌊iA​⌋−1)]可以看出来iii的最大值是无法取到1e91e91e9的需要开个根号。 AC代码 #include bits/stdc.h using namespace std;typedef long long LL;void Sol(LL A, LL B) {LL a, b, tmp, ret 0;for (int i 1; true; i ){tmp min(B, A / i - 1);// i 1 ~ tmpif (i 1 tmp) break;else ret (tmp - (i 1) 1);}cout ret endl; }int main() {int t; cin t;while (t -- ){static LL a, b;scanf(%lld%lld, a, b);Sol(a, b);}return 0; } D. Multiples and Power Differences 原题信息 http://codeforces.com/contest/1485/problem/D 解题思路 可恶啊这个题目是一个LCM的板子题没看出来。。。 首先我们对1~16求LCM x我们的 B 数组首先全是x可以满足multiplemultiplemultiple的性质然后我们凑性质三发现可以直接进行隔项加上ai,j4a_{i, j}^4ai,j4​而且数据范围小满足性质1 AC代码 #include bits/stdc.h using namespace std;typedef long long LL; const int N 510; int n, m; int a[N][N]; int b[N][N];int gcd(int x, int y) {if (y 0) return x;else return gcd(y, x % y); }int lcm(int x, int y) {return LL(x) * y / gcd(x, y); }int main() {cin n m;for (int i 1; i n; i )for (int j 1; j m; j )scanf(%d, a[i][j]);int x 1;for (int i 1; i 16; i ){x lcm(x, i);}for (int i 1; i n; i )for (int j 1; j m; j )b[i][j] x;for (int i 1; i n; i ){for (int j (i % 2 1 ? 1 : 2); j m; j 2){b[i][j] (a[i][j] * a[i][j]) * (a[i][j] * a[i][j]);}}// outputfor (int i 1; i n; i ){printf(%d, b[i][1]);for (int j 2; j m; j )printf( %d, b[i][j]);puts();}return 0; } 总结 首先考虑暴力能否直接缩小范围省时间其次考虑复杂度的时候分析准确一些多考虑边界的情况1-1最后题型要把握清楚数据范围小的时候有时候会暴力有时候直接lcm。。。
http://www.pierceye.com/news/816470/

相关文章:

  • 企业网站建设费用属管理费用吗重庆网站建设制作设计公司哪家好
  • 深圳营销型网站需要多少钱做网站个体户经营范围
  • php 手机网站 上传图片晋州做网站的联系电话
  • 云天下网站建设做抖音seo排名软件是否合法
  • 网站开发合同管辖权异议龙岩网上办事大厅官网
  • 建网站费用明细海口建设网站
  • 网站页面设计说明怎么写影视小程序源码
  • 传媒网站制作网站申请建设
  • 前端做项目的网站新密市城乡建设局网站
  • 网站app建设方案智能外呼系统
  • 创建网站免费注册wordpress 熊掌号代码
  • 的广州建网站的公司黄山市网站建设
  • 做网站外包需要提供什么登录百度账号
  • 网站备案要买备案号西安鑫瀚通网站建设
  • 做网站的公司违约怎么处理免费免费网站模板
  • 动漫网站建设方案项目书目录做网站站长先把作息和身体搞好
  • 网站建设说明书网页制作成品图加代码
  • 中国网站设计师联盟福州网站大全
  • 香奈儿网站建设竞价培训
  • 毕业设计做网站的步骤电脑培训学校在哪里
  • 怎样在网站图片上做店铺广告公司名logo设计图片
  • 做ic什么网站好攀枝花三线建设网站
  • 台州市网站建设东莞网站策划
  • 网站建设响应技术wordpress502
  • 开个捕鱼网站怎么做网络销售面试问题有哪些
  • 外国纪录片网站机场建设海外seo是什么
  • 一个服务器做多个网站微信商城和网站建设
  • 网站的基本类型地推平台
  • 简单的企业小网站网页统计代码大全
  • 中国手机网站建设公司大气网站建设