
CodeForces
文章平均质量分 59
恶魔之爪
码农一个
展开
-
CF629D Babaei and Birthday Cake
努力学习DP过程中,这题与最大递增子序列相似,不过如果用一般的DP方法算法复杂度为O(n^2),TEL。因此必须改用lower_bound使复杂度降为O(nlogn)便可AC。#include using namespace std;const double pi = 3.141592653589793;int n;vector cake;int indice[100010];i原创 2016-04-30 22:57:32 · 386 阅读 · 0 评论 -
CF670C Cinema
这是Codeforces Round #350的一道题目,其实非常简单,但在比赛的时候被坑惨了,卡在这题上让我rating掉了80多。。。。原因是不懂得运用STL里面的map,单纯的遍历而导致超时哎。不过不管怎么样,也算学到了点知识,学会了与map相关的函数,并懂了用map建立hash表能够大大的节省时间。。。。。#include using namespace std;int a[20原创 2016-05-06 13:59:02 · 531 阅读 · 0 评论 -
CF670D2 Magic Powder
这题需要用到二分法,由于输入样例1#include using namespace std;int a[100010];int b[100010];int n, k, result;void search(long long left, long long right){ long long mid = (left + right) / 2; long long c原创 2016-05-07 00:49:00 · 301 阅读 · 0 评论 -
CF677C Vanya and Label
其实这是一条Codeforces上的水题,但是想要做对也不容易……例如我就没想出方法,最后只好看题解才做出。这题要判断有多少种方法通过逻辑与“&”来获得输入的字符串,其中每个字符对应的数值如上面描述。由于字符的数值的范围为0~63,即2^6-1,那么每个字符可以转化为6位的二进制数,然后我们用一个循环来统计这个字符串所有字符转化为二进制后一共有多少位数为“0”即可,因为当一个位为“0”的时候,原创 2016-06-07 13:09:19 · 1676 阅读 · 0 评论 -
CF1C Ancient Berland Circus
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygo原创 2016-06-08 18:15:29 · 382 阅读 · 0 评论 -
CF2A Winner
简单的一道题。。。不停WA,还是改不了思维不缜密的坏习惯啊。。浪费好多时间,,说多都是泪。题目出处:http://codeforces.com/contest/2/problem/A#include using namespace std;map m;map m1;string name;int score;struct Player{ string name; int原创 2016-06-08 19:46:09 · 334 阅读 · 0 评论 -
CF1B Spreadsheet
一道字符串相关的比较水的题目。。不过调试无数次后才AC,,,果然我思维还是不够缜密比较水。。#include using namespace std;int typeJudge(string s){ if (s[0] != 'R' || s[1] == 'C') return 2; bool foundR = false; bool foundC = false; for (in原创 2016-06-08 13:40:35 · 340 阅读 · 1 评论 -
CF1A Theatre Square
Codeforces上的第一题。。毫无疑问水的不行,立志从今天开始每天刷Codeforces走上红名之路。#include using namespace std;int main(){ long long n,m,a; long long row,col; cin>>n>>m>>a; if(n%a==0) col=n/a; else col=n原创 2016-06-08 13:46:03 · 256 阅读 · 0 评论