CY_

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2014年4月27日

摘要: 今天回到宿舍以后,宿舍就剩自己了,然后就胡思乱想了。。 虽然最近一直在各个OJ上做题,但是感觉进步很少,ACM需要的知识太多了,自己会的就太少了,突然就丧失信心了。。然后找了一个小伙伴聊天,他的一句话让我稍微清醒了点,他说的是车到山前必有路!!我总是想的太多,把事情想得太复杂,所以我总是会迷惑。。其实,我不需要想那么多的,我只要根据自己的计划一步一步来就行了。。未来的事情无法预测,只要现在做好了,我想未来肯定也不会差。。我不知道别人是看待自己的ACM之路的,,我觉得自己的ACM是一个学习的过程,在OJ上A题的过程中,对一个知识,我从不会到查资料,到A题,完全熟悉知识点的过程,我觉得这个过程.. 阅读全文
posted @ 2014-04-27 22:33 CY_ 阅读(93) 评论(0) 推荐(0) 编辑

摘要: Time Limit: 5000MS Memory limit: 65536K题目描述Haveyou ever played a popular game named "Fruit Ninja"?Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for NvidiaTegra 2 based Android devices) is a video game developed by Halfbrick. It wasreleased April 21, 2010 for iPod Tou 阅读全文
posted @ 2014-04-27 18:43 CY_ 阅读(175) 评论(0) 推荐(0) 编辑

2014年4月26日

摘要: Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,你被要求写一个程序来判断这两只青蛙是否能够碰面,会在什么时候碰面。我们把这两只青蛙分别叫做青蛙A和青蛙B,并且规定纬度线上东经0度处为原点,由东往西为正方向,单位长度1米,这样我 阅读全文
posted @ 2014-04-26 15:26 CY_ 阅读(292) 评论(0) 推荐(0) 编辑

摘要: Description定义An为1,2,…,n的最小公倍数,例如,A1= 1,A2= 2,A3= 6,A4= 12,A5= 60,A6= 60。请你判断对于给出的任意整数n,An是否等于An – 1。Input本题有多组测试数据,输入的第一行是一个整数T代表着测试数据的数量,接下来是T组测试数据。对于每组测试数据:第1行包含一个整数n(2 ≤n≤ 106)。Output对于每组测试数据:第1行如果An等于An-1则输出YES否则输出NO。Sample Input16Sample OutputYES/***********************突然认识到基础不扎实,练习一下打基础,数论欧几里得 阅读全文
posted @ 2014-04-26 14:06 CY_ 阅读(173) 评论(0) 推荐(0) 编辑

2014年4月25日

摘要: Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case number,1using namespace std;int Euler(int x)// 求 欧拉函数值 其实就是通式的应用{ int i,res = x; for(i = 2;i*i1) res = res / x*(x-1);// x ... 阅读全文
posted @ 2014-04-25 18:57 CY_ 阅读(127) 评论(0) 推荐(0) 编辑

2014年4月21日

摘要: Binomial CoeffcientsTimeLimit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述输入输出示例输入31 110 2954 723示例输出1453557658/*******************组合数学组合数 用 递推 :组合数公式 C[n][m] =C[n-1][m-1] +C[n-1][m]************************/Code:#include #includeusing namespace std;const int mod = 10000003;const int N = 1005;int C[N][ 阅读全文
posted @ 2014-04-21 21:11 CY_ 阅读(166) 评论(0) 推荐(0) 编辑

摘要: Crack MathmenTimeLimit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述Since mathmen take security very seriously, theycommunicate in encryptedmessages. They cipher their texts in this way: for everycharacther c in themessage, they replace c with f(c) = (the ASCII code ofc)n mod 1997if f(c) #include #incl 阅读全文
posted @ 2014-04-21 20:57 CY_ 阅读(164) 评论(0) 推荐(0) 编辑

2014年4月18日

摘要: 学习数据结构了,写下来,加深记忆。第一篇://system("cls"); 控制台屏幕刷新#include#include#include#define MAXSIZE 100typedef int DataType;typedef struct{ DataType data[MAXSIZE]; int length;}SeqList;//初始化顺序表SeqList SeqListInit( ){ SeqList L; //coutL.length-1) return -1;// 超出表范围,错误,返回-1 return L.data[i-1];//顺序表元素下标从0开始} 阅读全文
posted @ 2014-04-18 20:52 CY_ 阅读(194) 评论(0) 推荐(0) 编辑

摘要: Problem DescriptionConsidera positive integer X,and let S be the sum of all positive integer divisors of2004^X. Your job is to determine S modulo 29 (the rest of the division of S by29).Take X = 1 for an example. The positive integer divisors of 2004^1 are 1, 2, 3,4, 6, 12, 167, 334, 501, 668, 1002 阅读全文
posted @ 2014-04-18 19:56 CY_ 阅读(168) 评论(0) 推荐(0) 编辑

2014年4月14日

摘要: 题目描述We know thatif a phone number A is another phone number B’s prefix, B is not able to becalled. For an example, A is 123 while B is 12345, after pressing 123, we callA, and not able to call B.Given N phone numbers, your task is to find whether there exits two numbers Aand B that A is B’sprefix.输入 阅读全文
posted @ 2014-04-14 18:42 CY_ 阅读(189) 评论(0) 推荐(0) 编辑