A. The Useless Toy time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which…
http://codeforces.com/contest/834 A. The Useless Toy 题意: <,>,^,v这4个箭头符号,每一个都可以通过其他及其本身逆时针或者顺时针旋转得到. 现在给出起始符号和结束符号,以及旋转的次数,判断是逆时针还是顺时针或者是无法判断. 思路: 可以知道4为一个周期,所以就把次数对4取余数,看一个周期之内的操作就可以了,分别模拟顺时针和逆时针的操作,如果都可以到达或者都不可以到达,那么它们就是不可识别的行为,其它就可以判断顺时针或者逆时针了. 代码…
A. The Useless Toy:http://codeforces.com/contest/834/problem/A 题目意思:给你两个字符,还有一个n,问你旋转n次以后从字符a变成b,是顺时针还是逆时针还是无法确定. 思路: 直接把c=n%4,然后搞出a->b需要顺时针转x下, 那么4-x就是逆时针需要转多少下了,如果顺逆时间是一样的 ,肯定无法判断,如果等于其中一个那该顺时针顺时针,该逆时针逆时针,如果两个时间都不等于c那就是不确定了. 还有一点如果一开始a=b,那就不需要判断肯…
[Link]:http://codeforces.com/contest/834/problem/B [Description] [Solution] 模拟水题; 注意一个字母单个出现的时候,结束和开始一起写; [NumberOf WA] [Reviw] [Code] #include <bits/stdc++.h> using namespace std; #define int long long int n,k; char s[(int) 1e6+100]; int rest[500],…
B. The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven whic…
D. The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven whic…
The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which…
D. The Bakery Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake several types of cakes, and opened the bakery. Soon the expenses started to overcome the income, so…
B. The Festive Evening It's the end of July – the time when a festive evening is held at Jelly Castle! Guests from all over the kingdom gather here to discuss new trends in the world of confectionery. Yet some of the things discussed here are not sup…
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…