Problem - C - Codeforces 经典二分题目,就当练习一下板子,需要注意的是数据范围,r取1e13就好,取1e17,1e18会暴. #include <bits/stdc++.h> using namespace std; #define int long long #define PII pair<int,int> const int N = 2e5 + 5; int a[N],b[N]; map<int,int>mp; int n1=0,n2...
Codeforces. Programming competitions and contests, programming community
}intmain(){scanf("%d %d %d %d", &l1, &r1, &l2, &r2);return!printf("%d\n", Divide(l1, r1, l2, r2,30)); }
那能得到abc,abcbc,abcbc这样无限叠加 而如果没有a的话每个a字母都可以选择替换或者不替换 那就是 种选择 #include<bits/stdc++.h>#defineintlonglongusingnamespacestd;voidsolve(){string s,t;cin>>s>>t;if(t=="a"){cout<<1<<'\n';return;}for(inti=0;i<t.size();i++){if(t[i]=='a'...
Codeforces Beta Round 97 (Div. 1) Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for ...
Problem - C - Codeforces题意: 给定一个长度为 n(n \le 2\times10^5) 的数组 a(-10^9 \le a[i] \le 10^9) 。你可以多次执行以下操作。 先,选择一个下标 i (1 \le i \le n) 将 a[i] 乘以一个 -1 ,也就是 a[i] =…
Codeforces 上添加题目 创建 添加Polygon 题目链接 设置 Vjudge 上挂题 创建Vjudge 比赛 Vjudge 比赛中添加题目 Polygon 出题 注册、创建 Polygon 网址 进入网址后,先注册登陆,然后点击New Problem开始创建一个题目表格,注意此处的Name只是项目名,不是最终的题目名。
Codeforces 1042C (贪心+模拟) 题面 传送门 分析 思路简单,但代码较复杂的贪心 分类讨论: 有0 负数有奇数个:将绝对值最小(实际最大)的负数和0全部乘到一起,最后删掉0 负数有偶数个:将0全部乘到一起,最后删掉0 没有0 负数有奇数个:将绝对值最小(实际最大)的负数删掉...
codeforces 1349A(数学) 题意描述思路 AC代码 #include<bits/stdc++.h> #define x first #define y second #define PB push_back #define m dejavu1zz 2020/10/26 2440 codeforces 1133D(map+精度控制) map 题意描述思路 AC代码 #include<bits/stdc++.h> #define x first #define y second #define PB...
Codeforces 1407C的交互题部分怎样处理? 题意描述 思路 如果一个大数余去一个小数,则余数肯定小于小数。如果小数余去大数,则余数仍是小数。 根据这个性质,我们可以通过2n-1次询问来确定除最大值以外的数的位置。而最大值我们可以通过扫一遍数组来确定。 AC代码 代码语言:javascript 代码运行次数:0 运行 AI代码解...