摘要: AC代码 阅读全文
posted @ 2016-10-19 11:08 Ponytai1 阅读(133) 评论(0) 推荐(0)
摘要: AC代码 阅读全文
posted @ 2016-10-19 11:07 Ponytai1 阅读(197) 评论(0) 推荐(0)
摘要: AC代码 阅读全文
posted @ 2016-10-19 11:06 Ponytai1 阅读(139) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 int main () 4 { 5 int begin; 6 int end; 7 int cnt = 0; 8 scanf("%d %d",&begin,&end); 9 int i = 2; //i 作为素数 10 int j; //用来检验是否素数 11 ... 阅读全文
posted @ 2016-10-18 23:15 Ponytai1 阅读(151) 评论(0) 推荐(0)
摘要: 1 #include 2 int main () 3 { 4 int ret1; 5 int ret2; 6 int ret3; 7 double ret4; 8 int ret5; 9 int array[1000] = {0}; 10 int size; 11 int p = 0 ; ... 阅读全文
posted @ 2016-10-18 23:14 Ponytai1 阅读(147) 评论(0) 推荐(0)
摘要: 1 #include 2 int main () 3 { 4 int amount; 5 scanf("%d",&amount); 6 int cnt = 1; 7 8 while (amount > 0) 9 { 10 long a; 11 long b; 12 long ... 阅读全文
posted @ 2016-10-18 23:13 Ponytai1 阅读(155) 评论(0) 推荐(0)
摘要: AC 代码 阅读全文
posted @ 2016-10-18 23:12 Ponytai1 阅读(153) 评论(0) 推荐(0)
摘要: 1 #include 2 int main () 3 { 4 int coe; 5 int exp; 6 int flag = 1; 7 while(scanf("%d %d",&coe,&exp) == 2) //这一条语句好好想想 8 { 9 if(exp != 0 ) 10 { 11 ... 阅读全文
posted @ 2016-10-18 23:12 Ponytai1 阅读(281) 评论(0) 推荐(0)
摘要: 1008. 数组元素循环右移问题 (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 时间限制 400 ms 时间限制 400 ms 内存限制 65536 kB 内存限制 65536 kB 代码长度限制 8000 B 代码长度限制 8 阅读全文
posted @ 2016-10-18 23:11 Ponytai1 阅读(249) 评论(0) 推荐(0)
摘要: 反思:此题要注意判断素数的方法,用普通的方法会超出规定运算时间。 1.直接暴力从2开始直接不断判断x能否被其整除。 十分朴素,很明显x除以比自己一半大的数一定不是整数。 此法的时间复杂度为O(n). 2.只需观察从2到√n中是否能整除x,若没有则为素数 原理:任何一个数都可以看成是两个数相乘,设a 阅读全文
posted @ 2016-10-18 22:57 Ponytai1 阅读(195) 评论(0) 推荐(0)