
数学
文章平均质量分 80
ahfywff
这个作者很懒,什么都没留下…
展开
-
SGU102 Coprimes
求不大于n(1#include #include const int maxn = 10010;int n, cnt;int c[maxn], ys[maxn];bool p[maxn];int prime[maxn];void f() { // get primes memset(p, true, sizeof(p)); for (int i = 2;原创 2012-04-04 17:19:20 · 488 阅读 · 0 评论 -
sgu107 987654321 problem
问题:求n位数中平方数以“987654321”结束的数的个数。#include int main(){ int n; while (scanf("%d", &n) != EOF) { if (n < 9) printf("0\n"); else if (n == 9) printf("原创 2012-04-04 19:30:08 · 587 阅读 · 0 评论 -
SGU105 Div 3
105. Div 3time limit per test: 0.5 sec. memory limit per test: 4096 KBThere is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine原创 2012-04-04 20:03:40 · 840 阅读 · 0 评论 -
SGU126 Boxes
126. Boxestime limit per test: 0.5 sec. memory limit per test: 4096 KBThere are two boxes. There are A balls in the first box, and B balls in the second box (0 < A + B < 2147483648). It is p原创 2012-04-06 16:10:01 · 1110 阅读 · 0 评论