problemcutter

导航

2015年3月5日 #

SPOJ Problem 1030:Triple Fat Ladies

摘要: 水题。。寻找第k个立方末三位为888的数。暴力找规律后O(1)解决,要开long long。#includeint n,i,j;long long s;int main(){ scanf("%d",&n); while(n--){ scanf("%lld",&s); ... 阅读全文

posted @ 2015-03-05 19:56 problemcutter 阅读(132) 评论(0) 推荐(0)

SPOJ Problem 346:Bytelandian gold coins

摘要: 有一种价值n的硬币能换成n/2,n/3,n/4的三个硬币,要求硬币价值的和尽可能多。前十万打表,后面就BFS。。。#include#includeint a[100005];int q[100005],l,r,t,i,n;long long ans;int main(){ for (i=0;i... 阅读全文

posted @ 2015-03-05 19:07 problemcutter 阅读(132) 评论(0) 推荐(0)

SPOJ Problem 2148:Candy III

摘要: 和I一样水,只不过要注意的是输入数据会特别大,所以应该先取模再相加。#includelong long n,s,t,x,i;int main(){ scanf("%lld",&n); while(n--){ s=0; scanf("%lld",&t); ... 阅读全文

posted @ 2015-03-05 17:26 problemcutter 阅读(110) 评论(0) 推荐(0)

2015年3月4日 #

SPOJ Problem 4300:Rectangles

摘要: 用给定数目的单位方块,问能拼成多少种矩形。暴力求解。。#include#includeint n,i,j,ans;int main(){ scanf("%d",&n); for (i=1;i<=n;i++){ for (j=1;j<=int(sqrt(double(i)))... 阅读全文

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

SPOJ Problem 3442:The last digit

摘要: 求某数的某次幂最后一位,暴力找规律后取模。#include#includeint t,x,y,s;int a[20];int main(){ scanf("%d",&t); while(t--){ scanf("%d%d",&x,&y); s=2;x%=10;... 阅读全文

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

SPOJ Problem 54:Julka

摘要: 已知一堆苹果的数量和一个人与另一个人苹果数量的差,求每个人有几个苹果。需要用到高精度。#include#includechar x[105],y[105];int a[105],b[105],c[105];int l1,l2,i,j,s;int main(){ while(scanf("%s%... 阅读全文

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

SPOJ Problem 1025:Fashion Shows

摘要: 求两组数组一一对应相乘后和的最大值。。。换一下语风。。#include#include#includeusing namespace std;int n,t,i,j,ans,x;int a[1005],b[1005];int main(){ cin>>t; while(t--){ ... 阅读全文

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

SPOJ Problem 2123:Candy I

摘要: #include#includeint n,i,j,p,s;int a[10001];int abs(int p){return p>0?p:-p;}int main(){ while(scanf("%d",&n)&&n!=-1){ p=0; for (i=1;i<... 阅读全文

posted @ 2015-03-04 19:58 problemcutter 阅读(146) 评论(0) 推荐(0)

SPOJ Problem 7974:What's Next

摘要: 求数列下一项,啥都不说了,贡献了N多WA。。。#includeint main(){ int a,b,c; while(scanf("%d%d%d",&a,&b,&c)&&(a||b||c)){ if (b*2==c+a&&b!=a) printf("AP %d\n"... 阅读全文

posted @ 2015-03-04 17:29 problemcutter 阅读(100) 评论(0) 推荐(0)

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 阅读(99) 评论(0) 推荐(0)