分三类 1 1: 一个就好了 3 3:特殊讨论下 或 : 第一行奇序号的数放前面,偶序号的数放后面,第二行奇序号的数放前面,偶序号的数放后面,第二行依次类推 有点难写,真的菜 #include<iostream> #include<map> #include<iostream> #include<cstring> #include<cstdio> #include<set> #include<vector> #includ…
PROBLEM A. Shockers 题 http://codeforces.com/contest/906/problem/A 906A 907C 解 水题,按照题意模拟一下就行了 如果是 ‘ ! ’,那么该字符串中所有没出现的字符标记为否,如果是 ' . '那么该字符串中出现的字符全部标记为否 #include <iostream> #include <cstring> #include <cmath> #include <cstdio> using…
Masha and Bears Tic-Tac-Toe Shockers Seating of Students Party Power Tower Reverses…
B. Seating On Bus 题目连接: http://www.codeforces.com/contest/660/problem/B Description Consider 2n rows of the seats in a bus. n rows of the seats on the left and n rows of the seats on the right. Each row can be filled by two people. So the total capac…
C. Shockers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valentin participates in a show called "Shockers". The rules are quite easy: jury selects one letter which Valentin doesn't…
题目链接:http://codeforces.com/contest/906/problem/D 题目大意:给定n个整数w[1],w[2],……,w[n],和一个数m,然后有q个询问,每个询问给出一个l,r,求w[l]^w[l+1]^w[l+2]……w[r]  %m  ,即a[l]到a[r]的幂次方 解题思路:利用欧拉降幂公式 第一个要求a和p互质,第2个和第3个为广义欧拉降幂,不要求a和p互质,用在这题刚好. 因为有两种情况,所以我们需要自定义一下降幂取模公式. 我们对整个区间进行递归处理,每…
B:考虑2*m怎么构造.因为要求相邻的数不能再相邻,容易想到黑白染色之类的东西,考虑染个色然后大概把黑点扔一边白点扔一边.显然m<=3时无解.对m>4,m为偶数时,如1 2 3 4 5 6   7 8 9 10 11 12,就变换成1 3 5 2 4 6   8 10 12 7 9 11:m为奇数时,如1 2 3 4 5   6 7 8 9 10,就变换成1 3 5 2 4   7 9 6 8 10(当然奇偶没有本质区别).非常开心的发现我们只要把2*m的方案往下复制就可以得到n*m的方案了.…
A. Masha and bears 题意 人的体积为\(V\),车的大小为\(size\),人能钻进车的条件是\(V\leq size\),人对车满意的条件是\(2V\geq size\). 现知道 熊爸爸能钻进最大的车并且满意 熊妈妈能钻进中等的车并且满意 熊宝宝能钻进最小的车并且满意 Masha能钻进最小的车并且只对它满意 给定四人的体积(保证\(V1\gt V2\gt V3\)),要求给出三辆车的大小. 思路 考思维严谨性的题.// 还是有些怕的 假设三辆车大小分别为\(a,b,c\),…
D. Power Tower time limit per test 4.5 seconds memory limit per test 256 megabytes input standard input output standard output Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-ch…
Codeforces Round #486 (Div. 3) A. Diverse Team 题目连接: http://codeforces.com/contest/988/problem/A Description There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students…