这次的题目相对容易 但是智商依旧不够用 原因有三点 1.英文水平堪忧 2 逻辑不严密 3 细节掌握不够好 传送门 http://codeforces.com/contest/659 A 题目大意 圆环上有n个点 人从a位置出发 走b步 正负代表方向 (a+b%n+n)%n 需要特判 避免走到 0位置 观察数据范围 只需要(100*n+a+b-1)%n+1 还省去了特判 B 题目大意 有n个人的数据  m个地区 每个地区最少参赛2人 晋级2人 出线则输出 需要加赛 如第二个人和第三个人成绩一样 …
Codeforces Round #346 (Div. 2)---E. New Reform E. New Reform time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Berland has n cities connected by m bidirectional roads. No road connects a city…
题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; ; const int INF = 0x3f3f3f3f; int a[MAXN]; int main(void) //Codeforces Round #…
题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <algorithm> using namespace std; ; const int INF = 0x3f3f3f3f;…
题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight",…
题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; int main(void) //Codeforces Round #304 (Div. 2) A. Soldier…
题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during the collision. 是指i,j两辆车,而不是全部 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostream>…
题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> using namespace std; ; const int INF = 0x3f3f3f3f; vector<c…
题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <vector> #include <map> #include <queue> #includ…
题目传送门 /* 题意:套娃娃,可以套一个单独的娃娃,或者把最后面的娃娃取出,最后使得0-1-2-...-(n-1),问最少要几步 贪心/思维题:娃娃的状态:取出+套上(2),套上(1), 已套上(0),先从1开始找到已经套好的娃娃层数, 其他是2次操作,还要减去k-1个娃娃是只要套上就可以 详细解释:http://blog.csdn.net/firstlucker/article/details/46671251 */ #include <cstdio> #include <algor…
题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <string> #include <queue> #include <map> #include <se…
题目传送门 /* 水题:开个结构体,rk记录排名,相同的值有相同的排名 */ #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <string> #include <iostream> #include <queue> #include <map> #include <vector>…
题目传送门 /* 题意:给出无向无环图,每一个点的度数和相邻点的异或和(a^b^c^....) 图论/位运算:其实这题很简单.类似拓扑排序,先把度数为1的先入对,每一次少一个度数 关键在于更新异或和,精髓:a ^ b = c -> a ^ c = b, b ^ c = a; */ #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <…
题目传送门 /* 水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <map> using namespace std; ; const int INF = 0x3f3f3f3f;…
题目传送门 /* 比C还水... */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostream> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; ll a[MAXN]; int main(void) //Codeforc…
因为很久没有个人认真做题了 昨天晚上开了场虚拟cf来锻炼个人手速 选的是第一次做cf的场 那时候7出3还被hack...之后也没补题 这次做的时候顺便回忆了一下以前比赛的时候是怎么想的 发现经验还是很重要的.. E 给出n个城市和m条双向边 把所有的双向边都变成单向的 如果一个城市的入度为0 那它就是孤独的 问有多少个孤独的 想到一个联通分量中 如果没有环(树) 那么肯定有一个点是孤独的 有环就没有了 那就对于每一个未访问的点bfs一下 然后dfs判断有没有环 O(n)的复杂度 F 一个n*m的…
A. Round House 题目连接: http://www.codeforces.com/contest/659/problem/A Description Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent. Today Vasya got bored and dec…
B. Qualifying Contest 题目连接: http://www.codeforces.com/contest/659/problem/B Description Very soon Berland will hold a School Team Programming Olympiad. From each of the m Berland regions a team of two people is invited to participate in the olympiad.…
A. Round House Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent. Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he…
E. New Reform time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connecte…
E. New Reform Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no more than one road. It is not guaranteed that you can get from any city to any other one, using only…
C. Tanya and Toys In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1 to 109. A toy from the new collection of the i-th type costs i bourles. Tania has managed to col…
B. Qualifying Contest Very soon Berland will hold a School Team Programming Olympiad. From each of the m Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and it was attended…
A. Round House 题目链接http://codeforces.com/contest/659/problem/A Description Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent. Today Vasya got bored and decided t…
前三题水 A #include <bits/stdc++.h> typedef long long ll; const int N = 1e5 + 5; int main() { int n, a, b; std::cin >> n >> a >> b; int bb = b; if (b < 0) bb = -b; while (bb--) { if (b < 0) { a--; } else { a++; } if (a == 0) { a…
题目传送门 /* 模拟递推水题 */ #include <cstdio> #include <iostream> #include <cmath> #include <algorithm> #include <cstring> #include <string> #include <map> using namespace std; + ; const int INF = 0x3f3f3f3f; int a[MAXN][M…
题目传送门 /* 水题 a或b成倍的减 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <map> #include <set> #include <vector> #include <set&…
A. Calculating Function 水题,分奇数偶数处理一下就好了 #include<stdio.h> #include<iostream> using namespace std; int main() { long long n;scanf("%lld",&n); ==) printf("%lld\n",(n-1LL)/2LL - n); else printf("%lld\n",n/2LL); }…
D. Bicycle Race 题目链接http://codeforces.com/contest/659/problem/D Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straigh…
C. Tanya and Toys 题目链接http://codeforces.com/contest/659/problem/C Description In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1 to 109. A toy from the new collectio…