随笔分类 - codeforces
摘要:链接:http://codeforces.com/contest/1138/problem/D 啊啊啊啊啊啊,自闭啊,比赛的时候判断条件 if(s1[i-1]=='0') aa++;写成了 if(s1[i]=='0') aa++;少写了个-1,被hack了,上分场变成了掉分场。 思路; 题目需要t字
阅读全文
摘要:A. Water Buying 链接:http://codeforces.com/contest/1118/problem/A 实现代码: B. Tanya and Candies 链接:http://codeforces.com/contest/1118/problem/B 题意:给你一串序列,去
阅读全文
摘要:A. Be Positive 链接:http://codeforces.com/contest/1130/problem/A 题意: 给一段序列,这段序列每个数都除一个d(−1e3≤d≤1e3)除完后,如果正数的个数可以大于序列长度的一半输出这个d,否则输出0 思路: 直接找正数和负数的个数,正数个
阅读全文
摘要:A. Minimum Integer 链接:http://codeforces.com/contest/1101/problem/A 代码: B. Accordion 链接:http://codeforces.com/contest/1101/problem/B 思路:给你一个字符串你可以删除任何一
阅读全文
摘要:F. Cookies 链接:http://codeforces.com/contest/1099/problem/F 题意: 给你一棵树,树上有n个节点,每个节点上有ai块饼干,在这个节点上的每块饼干需要花费bi时间,有两个玩家,玩家一可以移动到当前点的子节点也可以申请游戏结束返回根节点并吃沿途的饼
阅读全文
摘要:A. Snowball 链接:http://codeforces.com/contest/1099/problem/A 思路:模拟 代码: B. Squares and Segments 链接:http://codeforces.com/contest/1099/problem/B 思路:思维题 实
阅读全文
摘要:D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output D. The Child a
阅读全文
摘要:C. Pythagorean Triples time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Pythagorean Tri
阅读全文
摘要:C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output C. Journey time limit per tes
阅读全文
摘要:C. Constructing Tests time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's denote a m-fr
阅读全文
摘要:F题 Problem F Philosopher’s Walk 题意:给你n,m,n代表一个长宽都为2的n次方的格子里,m代表走了从左下角开始走了m米,求最后的坐标。 思路: 看上图很容易便可以看出规律,每幅图都是由上一幅图在自身的四个区域进行不同的变化的到的,如第二幅图中,第一区域是第一副图向左转
阅读全文
摘要:C题 Problem C Game Map 思路: 之前暴力搜索写了好几发,一直超时,后面看其他人的题解发现要用记忆化搜索。。直接暴力搜的话有太多重 复的计算。 dist u 表示以u 为起点所能走的最长路径,通过dfs不断递归能获得以u为起点的最长路径,这条路径上的每个点 的dist必定是最大的(
阅读全文
摘要:A. Alex and broken contest time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Alex
阅读全文
摘要:A. Modular Exponentiation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The following p
阅读全文
摘要:A. Nearest Minimums time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an arr
阅读全文
摘要:C. Cheap Kangaroo time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output There are N kangaroos going out t
阅读全文
摘要:H. Hit! time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output "Hit!" is a popular game in ancient Bytelan
阅读全文
摘要:A. Search for Pretty Integers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are giv
阅读全文
摘要:A. Fair Game 题目链接:http://codeforces.com/contest/864/problem/A 水题 B. Polycarp and Letters 题目链接:http://codeforces.com/contest/864/problem/B 水题,写太急了,忘了考虑
阅读全文
摘要:A. Kirill And The Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Kirill plays a ne
阅读全文