摘要: B - Yet Another Crosses Problem CodeForces - 1194B #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN=5e4+10; string a[ 阅读全文
posted @ 2020-10-04 20:38 Leviathan_Sei 阅读(99) 评论(0) 推荐(0)
摘要: A - Calandar 根据题意可知,每月30天,每周5天,也就是说每年也是5的倍数。因此,只要确定一个月的一天是周几,就可以得出所有的答案。按照和他相差的天数取余,然后就可以得到。 #include<bits/stdc++.h> using namespace std; typedef long 阅读全文
posted @ 2020-10-04 13:33 Leviathan_Sei 阅读(67) 评论(0) 推荐(0)
摘要: A - Sum of Odd Integers 前N个奇数和为N^2,所以说,当N小于K^2时即为不满足条件。再判断一下特殊情况就行。 #include<bits/stdc++.h> using namespace std; int t ; int main(){ scanf("%d",&t); w 阅读全文
posted @ 2020-06-13 14:55 Leviathan_Sei 阅读(180) 评论(0) 推荐(0)
摘要: A - Dreamoon and Ranking Collection 大题:找到一个从1开始连续的数组。条件是在给出的数组后,再给你们k个空填补这个数组,让这个数组从1开始到k是连续得,k是最大的。 做法:使用map记录出现或者没出现,然后根据x的大小枚举出多少个没有出现的数,最后得出最大值。 # 阅读全文
posted @ 2020-06-05 10:25 Leviathan_Sei 阅读(129) 评论(0) 推荐(0)
摘要: A 题:https://vjudge.net/problem/CodeForces-1339B/origin 题意:将给的数组排序 |a1−a2|≤|a2−a3|≤…≤|an−1−an| 解法:每次找一个最大值,一个最小值。 #include<iostream> #include<cstdio> # 阅读全文
posted @ 2020-05-30 12:57 Leviathan_Sei 阅读(199) 评论(0) 推荐(0)
摘要: 题目:A - Candies CodeForces - 1343A 题意:给一个数n,在k>1的情况下找一个x符合:x+2x+4x+⋯+2k−1x=nx+2x+4x+⋯+2k−1x=n. 做法:先求2n的前缀和,然后然后每一项进行判断。 #include<iostream> #include<cst 阅读全文
posted @ 2020-05-26 21:13 Leviathan_Sei 阅读(124) 评论(0) 推荐(0)
摘要: A Phoenix and Balance 题意: 把2^1,2^2,……2^n;分成两份,两份的差最小,保证n是偶数。 因为2^n=S(n-1)+2; 则最小的差即为Sn-2*(S(n-1)-S(n/2-1)); #include<iostream> #include<cstdio> #inclu 阅读全文
posted @ 2020-05-20 17:25 Leviathan_Sei 阅读(133) 评论(0) 推荐(0)
摘要: A题 没看懂,数学水平达不到…… 最后是x可以被gcd(a,b)除后为偶数 #include<algothrim> #include<iostream> using namespace std; int gcd(int x,int y) { if(x%y==0) return y; return g 阅读全文
posted @ 2020-05-11 08:48 Leviathan_Sei 阅读(98) 评论(0) 推荐(0)
摘要: 5.2 2020年西北工业大学“编程之星”程序设计挑战赛(大学生程序设计创新实践基地队员春季选拔赛) A https://ac.nowcoder.com/acm/contest/5403/A #include<bits/stdc++.h> using namespace std; int n,m,a 阅读全文
posted @ 2020-05-11 08:40 Leviathan_Sei 阅读(98) 评论(0) 推荐(0)
摘要: 组队: H: #include<iostream> #include<cstdio> #include<set> #include<queue> #include<stack> #include<vector> #include<bitset> #include<cstring> #include< 阅读全文
posted @ 2020-04-18 14:46 Leviathan_Sei 阅读(204) 评论(0) 推荐(0)