Codeforces Round #581(Div. 2) CF 1204 A. BowWow and the Timetable 题解:发现,$4$的幂次的二进制就是一个$1$后面跟偶数个$0$. 所以暴力判一下就好. Code: #include <bits/stdc++.h> #define N 110 using namespace std; char s[N]; int main() { scanf("%s", s + 1); int n = strlen(s +…
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is unique among the competitors. The contest is conduct…
Round Corridor  Descriptions Amugae位于一个非常大的圆形走廊中.走廊由两个区域组成.内部区域等于nñ扇区,外部区域等于m米部门.在相同区域(内部或外部)的每对扇区之间存在壁,但在内部区域和外部区域之间没有壁.墙壁始终存在于12点钟位置. 内部区域的扇区被表示为(1,1),(1,2),...,(1,Ñ)(1,1),(1,2),…,(1,ñ)顺时针方向.外部区域的扇区被表示为(2,1),(2,2),...,(2,米)(2,1),(2,2),…,(2,米)以相同的方式…
1.Quasi-palindrome 题意:问一个字符串(你可以添加前导‘0’或不添加)是否是回文串 思路:将给定的字符串的前缀‘0’和后缀‘0’都去掉,然后看其是否为回文串 #include<iostream> using namespace std; int main() { int num; scanf("%d", &num); != && num % == ) num /= ; ; int tnum = num; while (tnum) {…
B. More Cowbell time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter, where there is actually grass inst…
Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7558   Accepted: 2596 Description The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo'…
题目链接:http://codeforces.com/contest/752/problem/C 题意:给出一系列机器人的行动方向(机器人会走任意一条最短路径),问最少标记几个点能让机器人按这个 路径走下去. 显然最后位置肯定要标记,然后怎么使得点最少呢.首先标记一下起点由于机器人走的是最短路一旦第i个点到 标记点的距离小于第i-1个点到标记点的距离是肯定不能这么走,于是这时就要标记一下上个点的位置,统计数 加1. #include <iostream> #include <cstrin…
题目连接:https://codeforces.com/contest/1323/problem/B 题意:给一个大小为n的a数组,一个大小为m的b数组,c数组是二维数组c[i][j]=a[i]*b[j],问面积为k的矩形有几个. 题解:先把k的所有因子存入一个数组里,然后遍历因子,表示在a数组有 i 个连续的1,那么如果在b数组里有 k/i 个连续的1,形成的矩形面积就是k(线代的矩阵乘法自己脑补一下吧),计算出a数组中符合条件的个数乘以b数组中符合条件的个数,然后把每个因子下的都加起来就是答…
$$2017-2018\ ACM-ICPC\ German\ Collegiate\ Programming\ Contest (GCPC 2017)$$ \(A.Drawing\ Borders\) \(B.Buildings\) Polya定理搞一搞 //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/std…
除夕夜之有生之年CF第一场 下午从奶奶家回到姥姥家,一看还有些时间,先吃点水果陪姥姥姥爷聊了会儿,再一看表,5:20....woc已经开场20分钟了...于是抓紧时间乱搞.. **A. Guest From the Past** time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Kolya Gerasimov loves kefi…