题目链接: http://codeforces.com/contest/669/problem/D 题意: 给你一个初始序列:1,2,3,...,n. 现在有两种操作: 1.循环左移,循环右移. 2.1,2位置交换,3,4位置交换,...,n-1,n位置交换 现在问执行了q次操作之后序列是什么,每次操作可以是两种操作的任意一种 题解: 我们把数列按位置的奇偶分为两堆,无论哪种操作,始终都还是这两堆,最多就是整堆的对换和一个堆内部的偏移. 所以我们只要记录第一个位置和第二个位置的数的变化(相当于每…
C. Little Artem and Random Variable 题目连接: http://www.codeforces.com/contest/668/problem/C Description Little Artyom decided to study probability theory. He found a book with a lot of nice exercises and now wants you to help him with one of them. Cons…
E. Little Artem and Time Machine 题目连接: http://www.codeforces.com/contest/669/problem/E Description Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply thi…
D. Little Artem and Dance 题目连接: http://www.codeforces.com/contest/669/problem/D Description Little Artem is fond of dancing. Most of all dances Artem likes rueda - Cuban dance that is danced by pairs of boys and girls forming a circle and dancing tog…
C. Little Artem and Matrix 题目连接: http://www.codeforces.com/contest/669/problem/C Description Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new contro…
B. Little Artem and Grasshopper 题目连接: http://www.codeforces.com/contest/669/problem/B Description Little Artem found a grasshopper. He brought it to his house and constructed a jumping area for him. The area looks like a strip of cells 1 × n. Each ce…
A. Little Artem and Presents 题目连接: http://www.codeforces.com/contest/669/problem/A Description Little Artem got n stones on his birthday and now wants to give some of them to Masha. He knows that Masha cares more about the fact of receiving the prese…
A - Little Artem and Presents (div2) 1 2 1 2这样加就可以了 #include <bits/stdc++.h> typedef long long ll; const int N = 1e5 + 5; int main() { int n; scanf ("%d", &n); int ans = n / 3 * 2; if (n % 3) { ans++; } printf ("%d\n", ans);…
D. Little Artem and Dance time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boy…
C. Little Artem and Matrix time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in t…