- 博客(18)
- 收藏
- 关注
转载 Codeforces Round #575 (Div. 3) A B C
Codeforces Round #575 (Div. 3)A#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e5+100;int n;ll a,sum=0;int main(){ cin >> n; whil...
2019-07-25 14:48:00
150
转载 Educational Codeforces Round 69 (Rated for Div. 2) A B C D
Educational Codeforces Round 69 (Rated for Div. 2)A#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e5+100;int t;int n;int a[N];int main(...
2019-07-25 14:43:00
187
转载 Codeforces Round #574 (Div. 2) A B C D1
Codeforces Round #574 (Div. 2)ADrinks Choosing#include<bits/stdc++.h>using namespace std;const int N = 1e3+100;typedef long long ll;int n,k;int a[N];int b;int cnt=...
2019-07-18 10:22:00
156
转载 洛谷 P1048 采药 01背包入门
P1048采药最近想学dp了一道非常简单入门的01背包,写此博客做一个教训,对01背包还不是特别熟,动态方程很容易就推出来了,但是写二维状态方程时wa了,然后改为一维过了。主要还是对01背包不熟悉。dp[i][j] 表示用 j 单位时间采前 i 种药草的最大价值。dp[i][j] = max( dp[i-1][j-e[i].t] + e[i].w , dp[i-1...
2019-07-16 11:17:00
193
转载 Educational Codeforces Round 68 (Rated for Div. 2) A B C
ARemove a Progression#include<bits/stdc++.h>using namespace std;#define ll long longconst int N=1e5+100;int main(){ int t; cin >> t; while(t--){ ll n , x; ci...
2019-07-15 18:58:00
132
转载 Codeforces Round #573 (Div. 2) A B C D
ATokitsukaze and Enhancement#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=1e5+100;int x;int main(){ cin >> x; int cnt = 0; if( x%4 ...
2019-07-13 11:51:00
146
转载 Codeforces Round #270 A B C
ADesign Tutorial: Learn from Math素数筛#include<bits/stdc++.h>using namespace std;const int N = 1e6 + 100;int a[N]={0};int main(){ int n; cin >> n; a[1] = 1; for(in...
2019-07-13 11:44:00
120
转载 Codeforces Round #269 (Div. 2) A B C
A:MUH and Sticks水题#include<bits/stdc++.h>using namespace std;int a[10]={0};int main(){ int c; for(int i=0;i<6;i++){ cin>>c; a[c]++; } bool flag=false;...
2019-07-12 11:56:00
92
转载 Codeforces Round #268 (Div. 2) A B C D
Codeforces Round #268 (Div. 2)AI Wanna Be the Guy水题#include<bits/stdc++.h>using namespace std;int a[1000]={0};int main(){ int n,p,c; cin>>n; for(int i=0;i<...
2019-07-11 16:10:00
127
转载 Codeforces Round #565 (Div. 3) A B C E
Codeforces Round #565 (Div. 3)ADivide it!由题可知,分别消掉1个2,3,5分别需要1,2,3的花费#include<bits/stdc++.h>using namespace std;typedef long long ll;ll q,n;int main(){ cin>>q;...
2019-06-11 17:15:00
118
转载 Codeforces Round #563 (Div. 2) A B C D
Codeforces Round #563 (Div. 2)A:Ehab Fails to Be Thanos题意:给你一个数组,是否存在一种顺序,使数组前一半和与后一半和不相等排序,前n项和 后n项和 是否相等。#include<bits/stdc++.h>using namespace std;const int N=1e4;...
2019-06-04 17:39:00
129
转载 Codeforces Round #402 (Div. 2) A B C D
Codeforces Round #402 (Div. 2)没补完。。。A:Pupils Redistribution题意:交换a、b数组中的值,使a、b中每个数值得数量相同统计a、b数组中每个数值得个数,用ai表示数组a中含 i 的个数if(ai+bi是奇数) 那么无论怎么交换,a、b中i的数量都不一样,输出-1;else | ai-bi | /2 表示数值 i...
2019-06-04 16:18:00
235
转载 Codeforces Round #401 (Div. 2) A B C D E
Codeforces Round #401 (Div. 2)第一套。刷100套cf,加油加油!!!ps:写题解时没看题,题意可能有错A:Shell Game题意:三个杯子,其中一个下面有东西,操作:先交换左和中间,再交换右和中间。给出n次操作后的状态,东西在x(0,1,或2)位置,让你求出初始东西在哪个位置。0 1 21 0 21 2 02 1 ...
2019-05-25 22:03:00
177
转载 图论点、边集和二分图的相关概念和性质
转自https://dsqiu.iteye.com/blog/1689505点覆盖、最小点覆盖点覆盖集即一个点集,使得所有边至少有一个端点在集合里。或者说是“点” 覆盖了所有“边”。。极小点覆盖(minimal vertex covering):本身为点覆盖,其真子集都不是。最小点覆盖(minimum vertex covering):点最少的点覆盖。点覆盖数(vertex co...
2019-05-09 16:28:00
776
转载 2019年湘潭大学程序设计竞赛(重现赛)
2019年湘潭大学程序设计竞赛(重现赛)A:Who's better?#include<bits/stdc++.h>using namespace std;int main(){ int n1,p1,s1,n2,p2,s2; cin>>n1>>p1>>s1; cin>>n2...
2019-05-04 23:21:00
224
转载 牛客练习赛43
牛客练习赛43A题:Tachibana Kanade Loves School水题,看清"YE5"和"N0"而不是"YES"、"NO";#include<bits/stdc++.h>using namespace std;int main(){ int n,a[110],b[110]; cin>>n; fo...
2019-04-06 15:03:00
214
转载 博客页面定制
通过两个大佬代码改的1.页面主体框架http://www.cnblogs.com/yescoolfan/p/3462350.html2.美化:https://www.cnblogs.com/yjlblog/p/8724881.html选择lesslsmore页面定制css代码:/*公用*/body { font-size:15px; p...
2019-04-05 13:47:00
270
转载 2251: Code Cleanups
原题:http://acm.csu.edu.cn:20080/csuoj/problemset/problem?pid=2251题意:a[i]天会出现一个垃圾,如果不清扫每天都会+1个垃圾.不能超过20个垃圾不清扫,问你最少清扫几次题解: 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 i...
2019-03-11 12:54:00
327
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人