
Codeforces
Tao_oc
加油
展开
-
Codeforces Round #446 (Div. 2)
A. Greed模拟ac:#include<bits/stdc++.h>#define MAXN 100005#define ll long longusing namespace std;int a[MAXN]={0};int main(){ int n,x; ll sum=0; scanf("%d",&n); f...原创 2019-02-14 23:29:22 · 148 阅读 · 0 评论 -
Codeforces Round #541 (Div. 2)
A. Sea Battletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn order to make the "Sea Battle" game more interesting, Boris decid...原创 2019-02-23 23:32:35 · 271 阅读 · 0 评论 -
Codeforces Global Round 1
A. Parity解析:如果b为偶,只有最后一个a会影响结果如果b为奇,就遍历累加a%2,结果为偶就是偶ac:#include<bits/stdc++.h>#define ll long long#define MAXN 100005using namespace std;ll a[MAXN]={0};int main(){ ll b,k;...原创 2019-02-10 18:10:28 · 245 阅读 · 0 评论 -
Codeforces Round #544 (Div. 3)[a,b,c,d,f1]
A. Middle of the Contest题意给两个时间,问中间时刻解析简单模拟ac:#include<bits/stdc++.h>using namespace std;int main(){ int a,b,c,d; scanf("%d:%d",&a,&b); scanf("%d:%d",&c,...原创 2019-03-09 15:35:05 · 430 阅读 · 0 评论 -
Codeforces Round #547 (Div. 3)[a,b,c,d,e,f], Codeforces Round #598 (Div. 3)
链接:Codeforces Round #547 (Div. 3)A. Game 23题意:给a和b,a可以选择a*2或者a*3来变成b,问最少几步变成b,变不出输出-1先判断b%a能否=0,c=b/a,c变成1的最小步数ac:#include<bits/stdc++.h>#define IOS std::ios::sync_with_stdio(false...原创 2019-03-20 20:11:25 · 142 阅读 · 0 评论 -
Codeforces Round #542(div2)
题目链接:http://codeforces.com/contest/1130A. Be Positive题意:给定n个数,a[1]~a[n],求一个数m,使得a[i]/m(向上取整)是正数的个数大于等于n/2(向上取整)解析:正数/1>0,负数/-1>0,0无法得正数我们分别记录正数和负数的个数a,b,如果a>=(n+1)/2 =>1,如果b>...原创 2019-03-13 00:58:03 · 169 阅读 · 0 评论 -
Educational Codeforces Round 62 (Rated for Div. 2)
Detective Book题意:一本书,第i页的答案在a[i]页上,按顺序看,直到今天看的每一页都有答案,第二天往下看一页,问几天看完这本书解析:直接模拟就可以ac:#include<bits/stdc++.h>#define IOS std::ios::sync_with_stdio(false);#define pb push_back#defin...原创 2019-03-24 23:28:53 · 85 阅读 · 0 评论 -
Codeforces Round #550 (Div. 3)
A. Diverse Strings题意:给一组字符串,判断这个字符串排序后是不是连续的,且每个字符只出现一次解析:直接按题意模拟就可以ac:#include<bits/stdc++.h>#define IOS std::ios::sync_with_stdio(false);#define pb push_back#define ll long lon...原创 2019-04-03 00:49:53 · 259 阅读 · 3 评论