又掉分了0 0. A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He on…
http://codeforces.com/contest/896/problem/A 第i个字符串嵌套第i-1个字符串 求第n个字符串的第k个字母 dfs #include<map> #include<cstdio> #include<iostream> using namespace std; typedef long long LL; ]={" What are you doing at the end of the world? Are you bus…
C. Nephren gives a riddle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output What are you doing at the end of the world? Are you busy? Will you save us? Nephren is playing a game with little…
A. Scarborough Fair 题意 对给定的长度为\(n\)的字符串进行\(m\)次操作,每次将一段区间内的某一个字符替换成另一个字符. 思路 直接模拟 Code #include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { int n, m, s,t ; char c1, c2; char ss[110]; scanf("%d%d", &n, &m…
A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He once was th…
B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I experienced so many great things. — You gave me memories like dreams... But I have to le…
B:注意到nc/2<=m,于是以c/2为界决定数放在左边还是右边,保证序列满足性质的前提下替换掉一个数使得其更靠近边界即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #de…
A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He once was th…
D - Ithea Plays With Chtholly 思路:考虑每个位置最多被替换c/2次 那么折半考虑,如果小于c/2,从左往右替换,大于c/2总右往左替换,只有小于这个数(从左往右)或者大于这个数(从右往左)才会被替换,所以每个位置最多被替换c/2次. 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #defi…
[题目]B. Ithea Plays With Chtholly [题意]交互题,有n格,每次给一个[1,c]的数字,回答填入的位置后再次给数字,要求在m轮内使n格填满且数列不递减.n,m>=2,1<=c<=1000,1<=n*[c/2]<=m<=1000. [算法]贪心 [题解]对于每次的数字x,找到第一个严格大于的位置替换之(或占一个新的空位置). 这样替换的好处是,不改变当前数列已经满足不递减这一事实的前提下,使数列更优. 那么,每个格子最多被替换c次,总轮数为(…
A. Is it rated? time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to a…
A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to a…
大半夜呆在机房做题,我只感觉智商严重下降,今天我脑子可能不太正常 A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codeforces, and…
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…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... 其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/output 1 s, 256 MB x2377 B Queue standard input/output 2 s, 256 MB x1250 C Hacking Cypher standard input/output 1 s, 256 MB x740 D Chocolate standard in…
Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his info…
Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Victor adores the sets theory. Let us remind you that a set is a group of…