problemcutter

导航

2015年3月3日 #

SPOJ Problem 400:To and Fro

摘要: 题目大意:给你一个数字和一串字符串,要求排列成宽为给定数字的矩阵,奇数行字符串向右排列而偶数行向左,再从上到下输出。反正也是水题,模拟一下。#include#includeint n,i,j,l;char s[205],a[205];int main(){ while(scanf("%d",&... 阅读全文

posted @ 2015-03-03 20:21 problemcutter 阅读(105) 评论(0) 推荐(0)

SPOJ Problem 3410:Feynman

摘要: 水题,求1到n的平方和,直接代公式x=(1/6)*n*(n+1)*(2*n+1)#include#includeint main(){ int n,x; while(scanf("%d",&x)&&x){ printf("%d\n",x*(x+1)*(2*x+1)/6); ... 阅读全文

posted @ 2015-03-03 20:03 problemcutter 阅读(102) 评论(0) 推荐(0)

SPOJ Problem 1112:Number Steps

摘要: 水题,验证压代码能力。。。#include#includeint main(){ int n,x,y; scanf("%d",&n); while(n--){ scanf("%d%d",&x,&y); if (x!=y&&x-2!=y) ... 阅读全文

posted @ 2015-03-03 19:55 problemcutter 阅读(120) 评论(0) 推荐(0)

SPOJ Problem 24:Small factorials

摘要: 求阶乘,注意数据范围,要用高精。#include#includeint a[300];int n,x,y,l,i,j;int main(){ for (scanf("%d",&n);n--;){ scanf("%d",&x); memset(a,0,sizeof(a... 阅读全文

posted @ 2015-03-03 19:48 problemcutter 阅读(140) 评论(0) 推荐(0)

SPOJ Problem 11:Factoral

摘要: 这是一道水题,求某数阶乘结尾0的个数。啥都不说了,上代码#includeint n,x,y;int main(){ for (scanf("%d",&n);n--;){ for (scanf("%d",&x),y=0;x;x/=5)y+=x/5; printf("%... 阅读全文

posted @ 2015-03-03 19:36 problemcutter 阅读(142) 评论(0) 推荐(0)