![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces
invoKer-
这个作者很懒,什么都没留下…
展开
-
CodeForces - 33D Knights【水题】
题目链接:https://codeforces.com/contest/33/problem/D#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-03 19:56:29 · 192 阅读 · 0 评论 -
CodeForces - 33C Wonderful Randomized Sum【水题】
题目链接:https://codeforces.com/contest/33/problem/C#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 23:28:19 · 189 阅读 · 0 评论 -
CodeForces - 33B String Problem【水题】
题目链接:https://codeforces.com/contest/33/problem/B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 17:15:27 · 143 阅读 · 0 评论 -
CodeForces - 33A What is for dinner?【水题】
题目链接:https://codeforces.com/contest/33/problem/A#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 16:52:45 · 157 阅读 · 0 评论 -
CodeForces - 32E Hide-and-Seek【计算几何】
题目链接:https://codeforces.com/contest/32/problem/E先判两点之间是否被墙和镜子挡,再用相似三角形找入射点,乱搞判断一下。这题有点卡精度,EPS用1e-6能过,1e-8过不了。#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits&g原创 2021-05-01 16:25:51 · 178 阅读 · 0 评论 -
CodeForces - 32D Constellation【水题】
题目链接:https://codeforces.com/contest/32/problem/D#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 15:35:21 · 139 阅读 · 0 评论 -
CodeForces - 32C Flea【数学】
题目链接:https://codeforces.com/contest/32/problem/C好题,思路不好想#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#i原创 2021-05-01 14:53:09 · 125 阅读 · 0 评论 -
CodeForces - 32B Borze【水题】
题目链接:https://codeforces.com/contest/32/problem/B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 13:21:53 · 287 阅读 · 0 评论 -
CodeForces - 32A Reconnaissance【水题】
题目链接:https://codeforces.com/contest/32/problem/A#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-05-01 13:15:56 · 162 阅读 · 0 评论 -
CodeForces - 31E TV Game【DP】
题目链接:https://codeforces.com/contest/31/problem/E思路来自洛谷@Binary_Search_Treedp[i][j]表示第i位到第n位中A选了j位的最大A+B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#inc原创 2021-04-30 16:49:21 · 157 阅读 · 1 评论 -
CodeForces - 31C Schedule【水题】
题目链接:https://codeforces.com/contest/31/problem/C#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-04-22 21:59:45 · 147 阅读 · 0 评论 -
CodeForces - 31B Sysadmin Bob【水题】
题目链接:https://codeforces.com/contest/31/problem/B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-04-22 21:40:28 · 147 阅读 · 0 评论 -
CodeForces - 31A Worms Evolution【水题】
题目链接:https://codeforces.com/contest/31/problem/A#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-04-22 21:24:39 · 259 阅读 · 0 评论 -
CodeForces - 30D King‘s Problem?【贪心】
题目链接:https://codeforces.com/contest/30/problem/D#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-04-22 17:29:25 · 183 阅读 · 0 评论 -
CodeForces - 30C Shooting Gallery【DP】
题目链接:https://codeforces.com/contest/30/problem/C#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-15 21:14:31 · 111 阅读 · 0 评论 -
CodeForces - 30B Codeforces World Finals【水题】
题目链接:https://codeforces.com/contest/30/problem/B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-15 20:54:37 · 186 阅读 · 0 评论 -
CodeForces - 30A Accounting【水题】
题目链接:https://codeforces.com/contest/30/problem/A感觉这个题这么搜可以hack掉#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector原创 2021-02-15 18:37:11 · 112 阅读 · 0 评论 -
CodeForces - 29E Quarrel【最短路】
题目链接:https://codeforces.com/contest/29/problem/E#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-15 18:24:10 · 188 阅读 · 0 评论 -
CodeForces - 29D Ant on the Tree【DFS】
题目链接:https://codeforces.com/contest/29/problem/D#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-09 22:44:19 · 147 阅读 · 0 评论 -
CodeForces - 29C Mail Stamps【离散化】【DFS】
题目链接:https://codeforces.com/contest/29/problem/C#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-09 20:49:28 · 155 阅读 · 0 评论 -
CodeForces - 29B Traffic Lights【水题】
题目链接:https://codeforces.com/contest/29/problem/B#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-09 20:28:54 · 192 阅读 · 0 评论 -
CodeForces - 29A Spit Problem【水题】
题目链接:https://codeforces.com/contest/29/problem/A#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-02-09 17:35:06 · 108 阅读 · 0 评论 -
CodeForces - 28D Don‘t fear, DravDe is kind【DP】
题目链接:https://codeforces.com/contest/28/problem/D思路来自洛谷题解用map存转移的位置,优化 O(n2)O(n^2)O(n2) 的DP。#include <iostream>#include <map>using namespace std;static const int MAXN=2e5+10;map<int,int> ghs[MAXN];int dp[MAXN],nxt[MAXN],n,head;int原创 2021-02-09 16:17:14 · 253 阅读 · 0 评论 -
CodeForces - 28C Bath Queue【DP】
题目链接:https://codeforces.com/contest/28/problem/C#include <iostream>#include <algorithm>using namespace std;typedef long double db;static const int MAXN=50+10;db dp[MAXN][MAXN][MAXN];int a[MAXN];db C[MAXN][MAXN];int n,m;void init(){原创 2021-01-27 17:21:33 · 183 阅读 · 0 评论 -
CodeForces - 27C Unordered Subsequence【水题】【构造】
题目链接:https://codeforces.com/contest/27/problem/C#include <iostream>using namespace std;static const int MAXN=1e5+10;int n;int a[MAXN];int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); if(n>=原创 2020-11-09 18:21:00 · 114 阅读 · 0 评论 -
CodeForces - 27B Tournament【水题】
题目链接:https://codeforces.com/contest/27/problem/B#include <iostream>using namespace std;static const int MAXN=50+10;int g[MAXN][MAXN];int cnt[MAXN];int n;int main(){ scanf("%d",&n); for(int i=1;i<n*(n-1)/2;i++) { int原创 2020-11-09 18:19:56 · 154 阅读 · 0 评论 -
CodeForces - 27A Next Test【水题】
题目链接:https://codeforces.com/contest/27/problem/A#include <iostream>using namespace std;static const int MAXN=3000+10;bool vis[MAXN];int n,x;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&x);原创 2020-11-08 21:42:32 · 176 阅读 · 0 评论 -
CodeForces - 26D Tickets【组合数学】
题目链接:https://codeforces.com/contest/26/problem/D#include <iostream>using namespace std;int n,m,k;int main(){ scanf("%d%d%d",&n,&m,&k); if(m<=k) puts("1"); else if(m>n+k) puts("0"); else { double tmp=原创 2020-11-08 20:49:18 · 116 阅读 · 0 评论 -
CodeForces - 26C Parquet【构造】
题目链接:https://codeforces.com/contest/26/problem/C#include <iostream>#include <cctype>using namespace std;static const int MAXN=100+10;char g[MAXN][MAXN];int n,m,a,b,c;int main(){ scanf("%d%d%d%d%d",&n,&m,&a,&b,&c)原创 2020-11-07 22:00:04 · 188 阅读 · 0 评论 -
CodeForces - 26B Regular Bracket Sequence【水题】【贪心】【栈】
题目链接:https://codeforces.com/contest/26/problem/B#include <iostream>using namespace std;static const int MAXN=1e6+10;char s[MAXN];int cnt,ans;int main(){ scanf("%s",s); for(int i=0;s[i];i++) if(s[i]=='(') cnt++; else if(原创 2020-11-07 20:54:36 · 148 阅读 · 0 评论 -
CodeForces - 26A Almost Prime【水题】【分解质因数】
题目链接:https://codeforces.com/contest/26/problem/A#include <iostream>using namespace std;static const int MAXN=3000+10;int n,ans;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) { int t=i,cnt=0; for(int j=2;j&l原创 2020-11-07 20:41:26 · 265 阅读 · 0 评论 -
CodeForces - 25E Test【KMP】
题目链接:https://codeforces.com/contest/25/problem/E#include <iostream>#include <cstring>#include <algorithm>using namespace std;static const int MAXN=3e5+10;char s[3][MAXN];int ans,l[3],seq[3],nxt[MAXN];void get_next(int k){ for原创 2020-11-07 18:13:18 · 186 阅读 · 0 评论 -
CodeForces - 25D Roads not only in Berland【并查集】
题目链接:https://codeforces.com/contest/25/problem/D#include <iostream>#include <vector>using namespace std;static const int MAXN=1000+10;int p[MAXN];struct Edge{ int u,v;}same[MAXN];int n,idx;vector<int> root;void init() { for(原创 2020-11-06 18:00:16 · 87 阅读 · 0 评论 -
CodeForces - 25C Roads in Berland【Floyd】
题目链接:https://codeforces.com/contest/25/problem/C#include <iostream>using namespace std;static const int MAXN=300+10;int f[MAXN][MAXN];int n,m,u,v,w;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) for(int j=1;j<=n;j+原创 2020-11-06 14:16:53 · 129 阅读 · 0 评论 -
CodeForces - 25B Phone numbers【水题】
题目链接:https://codeforces.com/contest/25/problem/B#include <iostream>using namespace std;static const int MAXN=100+10;int n;char s[MAXN];int main(){ scanf("%d%s",&n,s); for(int i=0;s[i];) { if(n-i==2) printf("%c%c",s[i],s原创 2020-11-05 17:48:39 · 98 阅读 · 0 评论 -
CodeForces - 25A IQ test【水题】
题目链接:https://codeforces.com/contest/25/problem/A#include <iostream>using namespace std;int num[2],pos[2];int n;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) { int x; scanf("%d",&x); num[x%2]++;原创 2020-11-05 17:33:01 · 112 阅读 · 0 评论 -
CodeForces - 24E Berland collider【二分】
题目链接:https://codeforces.com/contest/24/problem/E#include <iostream>#include <algorithm>using namespace std;typedef double db;static const int MAXN=5e5+10;static const db EPS=1e-12;struct P{ int x,v; void input() { scanf("%d%d",&a原创 2020-11-05 16:13:42 · 144 阅读 · 0 评论 -
CodeForces - 24D Broken robot【期望DP】
题目链接:https://codeforces.com/contest/24/problem/D#include <iostream>using namespace std;typedef double db;static const int MAXN=1000+10;db dp[MAXN][MAXN];int n,m,x,y;int main(){ scanf("%d%d%d%d",&n,&m,&x,&y); for(int i=原创 2020-11-05 15:06:31 · 132 阅读 · 0 评论 -
CodeForces - 24C Sequence of points【思维】
题目链接:https://codeforces.com/contest/24/problem/C关键 走2n次会回到原点#include <iostream>using namespace std;static const int MAXN=1e5+10;struct Point{ int x,y; void input() { scanf("%d%d",&x,&y); }}a[MAXN],m;int n;long long j;int main原创 2020-11-05 13:38:07 · 97 阅读 · 0 评论 -
CodeForces - 24B F1 Champions【水题】
题目链接:https://codeforces.com/contest/24/problem/B#include <iostream>#include <cstring>#include <unordered_map>#include <algorithm>using namespace std;static const int score[55]={0,25,18,15,12,10,8,6,4,2,1};static const int MAX原创 2020-11-05 12:53:51 · 165 阅读 · 0 评论