Codeforces 271 Div 2 C. Captain Marmot】的更多相关文章

题目链接:http://codeforces.com/contest/474/problem/C 解题报告:给一个n,然后输入4*n个平面坐标系上的点,每四个点是一组,每个点有一个中心,这四个点可以分别围绕这个中心旋转,每次只能逆时针转90度,现在问你要使这四个点形成一个正方形最少要转的次数是多少. 枚举这四个点转的次数分别为0,1,2,3,只要这四种,因为再转的话就回到原来的状态循环了.然后对于每种情况分别判断是不是组成正方形就可以了,关键是求旋转后的坐标,和判断是不是正方形的问题. 假设这个…
B. Worms time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such…
题目链接:http://codeforces.com/contest/474/problem/B 解题报告:给你n个堆,第i个堆有ai个物品,物品的编号从1开始,第一堆的编号从1到a1,第二堆编号从a1+1到a1+a2.......,现在有m次查询,给你一个编号,让你求出这个编号的物品在第几个堆. 离线算法,先把m次查询按照编号从小到大排序,然后全部求出来之后按照输入的顺序排序就行了. #include<cstdio> #include<cstring> #include<i…
题目链接:http://codeforces.com/contest/474/problem/A 解题报告:一个矩形的键盘,上面只有规定的字符,现在按的时候总是会向某个方向按偏,也就是输入一串字符后,这串字符其实不是我要输入的字符,偏的方向只有左跟右,现在给你每次偏的方向跟输入的字符,让你求原来想要的字符串.注意不会出现按到键盘外的情况. 直接键盘上所有的字符先存到一起,然后左偏取的时候+1,右偏取的时候-1就行了. #include<cstdio> #include<cstring&g…
C. Captain Marmot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has n regi…
Codeforces Round #271 (Div. 2) A - Keyboard 题意 给你一个字符串,问你这个字符串在键盘的位置往左边挪一位,或者往右边挪一位字符,这个字符串是什么样子 题解 模拟一下就好了 代码 #include<bits/stdc++.h> using namespace std; string s[3]; map<char,int>r,c; char ss[2][107]; int main() { s[0]="qwertyuiop"…
题目地址:http://codeforces.com/contest/474 A题:Keyboard 模拟水题. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <que…
A. Keyboard 题意:一个人打字,可能会左偏一位,可能会右偏一位,给出一串字符,求它本来的串 和紫书的破损的键盘一样 #include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<algorithm> using namespace std; typedef long long LL; ]="qwertyuiopasdfghjkl;…
C. Captain Marmot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has n regi…
4*4*4*4暴力+点的旋转+推断正方型 C. Captain Marmot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this…