随笔分类 -  CodeChef

大数加减法实现
摘要:传送门 1 /* 2 * input: an expression seperated by a '-' or '+'; for example: a-b, a+b 3 * ouput: the answer of the input expression 4 */ 5 #includ... 阅读全文

posted @ 2015-01-14 15:16 Stomach_ache 阅读(192) 评论(0) 推荐(0) 编辑

位操作(求[a, b] 中二进制位为1的个数最多的数)
摘要:传送门题意:求区间[a, b]中二进制位为1的个数最多的那个数,如果存在多解,则输出最小的那个。(0 2 3 typedef long long ll; 4 5 int main(void) { 6 int n; 7 scanf("%d", &n); 8 while (... 阅读全文

posted @ 2015-01-14 15:14 Stomach_ache 阅读(241) 评论(0) 推荐(0) 编辑

LTIME16小结(CodeChef)
摘要:题目链接最后一题是Splay...还没有学会。。蒟蒻!!!A 1 /************************************************************************* 2 > File Name: A.cpp 3 > Author: S... 阅读全文

posted @ 2014-09-28 20:11 Stomach_ache 阅读(271) 评论(0) 推荐(0) 编辑

Lowest Common Ancestor (LCA)
摘要:题目链接In a rooted tree, thelowest common ancestor(or LCA for short) of two verticesuandvis defined as the lowest vertex that is ancestor of both that tw... 阅读全文

posted @ 2014-09-24 19:59 Stomach_ache 阅读(526) 评论(0) 推荐(0) 编辑

COOK50小结
摘要:题目链接很遗憾。看到第五题的通过人数就不敢做了。待日后补上。A题求最长的连续子序列,使得他们满足gcd为1。如果有相邻的两个数的gcd为1,那么整个序列的gcd值也就是1,否则就是该序列不存在。 1 /*************************************************... 阅读全文

posted @ 2014-09-24 14:19 Stomach_ache 阅读(180) 评论(0) 推荐(0) 编辑

CodeChef--SEPT14小结
摘要:这套题目只做了几个相对简单的。其他的做起来比较吃力。A找下规律 1 /************************************************************************* 2 > File Name: A.cpp 3 > Author: ... 阅读全文

posted @ 2014-09-17 15:25 Stomach_ache 阅读(226) 评论(0) 推荐(0) 编辑

CodeChef--Cards, bags and coins
摘要:题目链接Yet another game from chef. Chef gives youNcards andMbags. Each of theNcards has an integer written on it. Now chef asks you to close your eyes an... 阅读全文

posted @ 2014-09-04 21:58 Stomach_ache 阅读(219) 评论(0) 推荐(0) 编辑

CodeChef--EQUAKE
摘要:题目链接Earthquake in Bytetown! Situation is getting out of control!All buildings in Bytetown stand on straight line. The buildings are numbered0, 1, ...,... 阅读全文

posted @ 2014-09-04 09:50 Stomach_ache 阅读(256) 评论(0) 推荐(0) 编辑

Clash Credenz 2014 Wild Card Round题解
摘要:A题简单模拟。 1 /************************************************************************* 2 > File Name: A.cpp 3 > Author: Stomach_ache 4 > Mai... 阅读全文

posted @ 2014-09-02 18:33 Stomach_ache 阅读(262) 评论(0) 推荐(0) 编辑

CodeChef August Lunchtime 2014 题解
摘要:A题给一个由a和b两种类型的字符组成的字符串,每次可以从中选取任意长度的回文子序列(不一定连续)并删除。问最少需要几次能将整个字符串为空。思路:如果本身是个回文串,那么只需要一次,否则需要两次(第一次选全部的a,第二次全部选b)。Accepted Code: 1 def is_palidrome(s... 阅读全文

posted @ 2014-08-31 21:38 Stomach_ache 阅读(220) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示