随笔分类 -  ACM_陈涛涛

摘要:阶乘因式分解(一)时间限制:3000ms | 内存限制:65535KB难度:2描述给定两个数m,n,其中m是一个素数。将n(0using namespace std;int shumu(int a,int b){ int c = 0; while(a%b == 0) { c++; a=a/b; ... 阅读全文
posted @ 2015-01-31 20:30 NYNU_ACM 阅读(268) 评论(0) 推荐(0)
摘要:一种排序时间限制:3000ms | 内存限制:65535KB难度:3描述现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求按照一下方式排序(默认排序规则都是从小到大);1.按照编号从小到大排序2.对于编号相等的长方形,按照长方形的长... 阅读全文
posted @ 2015-01-20 18:03 NYNU_ACM 阅读(283) 评论(0) 推荐(0)
摘要:#include#includeint main(){ const int MOD = 1000000; int i, j, n, s = 0; scanf("%d,",&n); for(i = 1;i ,改成c++的#include也行人后只要在最后面加上(double)clock()/CLOCK... 阅读全文
posted @ 2015-01-19 20:06 NYNU_ACM 阅读(323) 评论(0) 推荐(0)
摘要:会场安排问题时间限制:3000 ms | 内存限制:65535 KB难度:4描述 学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,... 阅读全文
posted @ 2015-01-17 17:19 NYNU_ACM 阅读(221) 评论(0) 推荐(0)
摘要:一种排序时间限制:3000 ms | 内存限制:65535 KB难度:3描述 现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求按照一下方式排序(默认排序规则都是从小到大);1.按照编号从小到大排序2.对于编号相等的长方形,按照长方... 阅读全文
posted @ 2015-01-17 15:25 NYNU_ACM 阅读(199) 评论(0) 推荐(0)
摘要:#includeusing namespace std;int main(){ int n; while(cin>>n) { int count=0; while(n != 1){ if(n%2==0)n=n/2; else n=3*n+1; count++; } cout<<... 阅读全文
posted @ 2015-01-11 22:52 NYNU_ACM 阅读(148) 评论(0) 推荐(0)
摘要:#includeusing namespace std;int main(){ int n; while(cin>>n) { if(n%4 == 0&&n%100 != 0||n%400 == 0) cout<<"Yes"<<endl; else cout... 阅读全文
posted @ 2015-01-11 22:42 NYNU_ACM 阅读(202) 评论(0) 推荐(0)
摘要:#include#includeusing namespace std;int main(){ int a,b,c; while(cin>>a>>b>>c) { int temp; if(a>b){ temp=a; a=b; b=temp; } if(a>c){ temp=a... 阅读全文
posted @ 2015-01-11 22:35 NYNU_ACM 阅读(457) 评论(0) 推荐(0)
摘要:atan函数:返回数值的余切值原型:double atan(double x)#include#includeusing namespace std;int main(){ double PI = 4.0*atan(1.0); double r; while(cin>>r) { cout<<"PI... 阅读全文
posted @ 2015-01-08 23:14 NYNU_ACM 阅读(1412) 评论(0) 推荐(0)
摘要:#includeusing namespace std;typedef struct LNode { int data; struct LNode *next;}LNode , *LinkList;LNode *p,*q;LinkList H;//求链表的长度int ListLength(LinkL... 阅读全文
posted @ 2015-01-06 17:16 NYNU_ACM 阅读(166) 评论(0) 推荐(0)
摘要:#include#includeusing namespace std;#define MAX 500 //宏定义方式定义符号常量 比较少用 const int maxlength=500; //const定义常变量 比较常用 typedef struct elemtype{... 阅读全文
posted @ 2015-01-06 17:14 NYNU_ACM 阅读(250) 评论(0) 推荐(0)
摘要:B -确定比赛名次Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescription有N个比赛队(1#include#includeusing namespace std;typedef ... 阅读全文
posted @ 2015-01-05 10:25 NYNU_ACM 阅读(339) 评论(0) 推荐(0)
摘要:A -ATime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionBessie has gone to the mall's jewelry store and spies a c... 阅读全文
posted @ 2014-12-28 20:45 NYNU_ACM 阅读(223) 评论(0) 推荐(0)
摘要:头文件: or 在c语言中功能:判断一个字符是否是英文字符,是大写返回1,是小写返回2,不是英文字符返回0;在标准c中相当于isuppe(ch) 和islower(ch)案例:将字符串中的非字符略掉:#include#includeusing namespace std;int main(){ i... 阅读全文
posted @ 2014-12-27 17:51 NYNU_ACM 阅读(518) 评论(0) 推荐(0)
摘要:以10为底的log函数:形式为 double log10(double x)以e为底的log函数(即 ln)double log (double x)如何表达log 以a为底b的对数:用换底公式:可以表达为:log(a)/log(b)#include#includeusing namespace s... 阅读全文
posted @ 2014-12-27 15:49 NYNU_ACM 阅读(2222) 评论(0) 推荐(0)
摘要:C -字符识别?Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluSubmitStatusDescription你的任务是写一个程序进行字符识别。别担心,你只需要识别1, 2, 3,如下:.*. *** ***.*. .... 阅读全文
posted @ 2014-12-21 22:23 NYNU_ACM 阅读(384) 评论(0) 推荐(0)
摘要:G -好老师Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluSubmitStatusDescription我想当一个好老师,所以我决定记住所有学生的名字。可是不久以后我就放弃了,因为学生太多了,根本记不住。但是我不能让... 阅读全文
posted @ 2014-12-21 20:36 NYNU_ACM 阅读(254) 评论(0) 推荐(0)
摘要:J -搞笑版费马大定理Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluSubmitStatusDescription费马大定理:当n>2时,不定方程an+bn=cn没有正整数解。比如a3+b3=c3没有正整数解。为了活... 阅读全文
posted @ 2014-12-21 12:25 NYNU_ACM 阅读(218) 评论(0) 推荐(0)
摘要:D -Common SubsequenceTime Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA subsequence of a given sequence is the... 阅读全文
posted @ 2014-12-15 18:19 NYNU_ACM 阅读(179) 评论(0) 推荐(0)
摘要:A -数塔Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescription在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步... 阅读全文
posted @ 2014-12-15 09:48 NYNU_ACM 阅读(220) 评论(0) 推荐(0)