我一开始把题目看错了 我以为是博弈.. 这题就是一个简单的判环+dfs(不简单,挺烦的一题) #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <vector> const int N = 2e5 + 5; struct GraphNode { int toVertex, nex…
Codeforces Round #467 (div.2) 我才不会打这种比赛呢 (其实本来打算打的) 谁叫它推迟到了\(00:05\) 我爱睡觉 题解 A. Olympiad 翻译 给你若干人的成绩 让你划定一个分数线 使得所有不低于这个分数线的人都可以获奖 但是\(0\)分的人一定不能得奖 问你有多少种获奖情况 题解 \(sort+unique\) 然后判断一下最小值是不是\(0\)就行了 #include<iostream> #include<cstdio> #include…
2018-03-03 http://codeforces.com/problemset/problem/937/B B. Vile Grasshoppers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The weather is fine today and hence it's high time to climb th…
A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points. As the head…
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> const int maxLength = 2005; char s[maxLength], t[maxLength]; int letterOfS[30]; int letterOfT[30]; std::vector<int> result;…
B:显然即相当于能否找一条有长度为奇数的路径使得终点出度为0.如果没有环直接dp即可.有环的话可以考虑死了的spfa,由于每个点我们至多只需要让其入队两次,复杂度变成了优秀的O(kE).事实上就是拆点.方案的输出在spfa过程中记录即可.然后判一下由起点是否能走进一个环,若可以至少是平局. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cst…
Lock Puzzle 题目大意:给你两个字符串一个s,一个t,长度<=2000,要求你进行小于等于6100次的shift操作,将s变成t, shift(x)表示将字符串的最后x个字符翻转后放到最前面. 思路:不会写,看了题解... 因为长度为3000,操作为6500,我们考虑每三次操作将一个字符放到最后,并保证其他字符的顺序不变,这样是可以实现的, 如果我们想要将第k个字符移到最后,我们只要shift(n-1-k) , shift(1) , shift(n-1),就能实现啦 . #includ…
B. Vile Grasshoppers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The weather is fine today and hence it's high time to climb the nearby pine and enjoy the landscape. The pine's trunk in…
A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of points. As the head…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…