This commit is contained in:
Saturneric 2020-09-01 00:46:43 +08:00
parent 60a5286dd3
commit 52668c4122
438 changed files with 2493 additions and 0 deletions

15
15/main.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
int main(void){
double a = 0.0;
int i, count = 0;
do{
a = ++count;
for(i = 0;i < 5; i++){
a = (5.0/4.0 * a) + 1;
}
}while((a - (int)a) > 10e-6);
printf("%.0lf %d\n",a,count);
return 0;
}

BIN
15/problem.build Normal file

Binary file not shown.

0
15/problem.set Normal file
View File

0
15/stdin Normal file
View File

1
15/stdout Normal file
View File

@ -0,0 +1 @@
3121 1020

6
17/main.c Normal file
View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main(void){
return 0;
}

0
17/problem.set Normal file
View File

0
17/stdin Normal file
View File

0
17/stdout Normal file
View File

15
20/main.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
int main(void){
int number, i;
scanf("%d",&number);
printf("%d*%d*%d=%lu=",number,number,number,(unsigned long)number*number*number);
int k = number * number - number + 1;
for(i = 0; i < number; i++,k += 2){
if(i) printf("+");
printf("%d",k);
}
printf("\n");
return 0;
}

0
20/problem.set Normal file
View File

0
20/stdin Normal file
View File

0
20/stdout Normal file
View File

21
21/main.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
int main(void){
int number,n[20];
scanf("%d",&number);
int i;
for(i = 0; i < number; i++){
scanf("%d",&n[i]);
}
int max = -1, now = 1;
for(i = 0; i < number; i++){
if(n[i] > 0){
now *= n[i];
if(now > max) max = now;
}
}
if(max > 0)
printf("%d\n",max);
else printf("-1\n");
return 0;
}

BIN
21/problem.build Normal file

Binary file not shown.

0
21/problem.set Normal file
View File

2
21/stdin Normal file
View File

@ -0,0 +1,2 @@
5
2 5 -1 2 -1

1
21/stdout Normal file
View File

@ -0,0 +1 @@
20

6
22/main.c Normal file
View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main(void){
printf("192 384 576\n219 438 657\n273 546 819\n327 654 981\n");
return 0;
}

BIN
22/problem.build Normal file

Binary file not shown.

0
22/problem.set Normal file
View File

0
22/stdin Normal file
View File

4
22/stdout Normal file
View File

@ -0,0 +1,4 @@
192 384 576
219 438 657
273 546 819
327 654 981

27
23/main.c Normal file
View File

@ -0,0 +1,27 @@
#include <stdio.h>
int n[30],number;
long long count = 0;
int tdo(int deep);
int main(void){
scanf("%d",&number);
tdo(1);
printf("%lld\n",count);
return 0;
}
int tdo(int deep){
int i,k;
for(i = 1; i <= 2; i++){
n[deep] = i;
if(deep > 2)
if(n[deep] == 2 && n[deep-1] == 2 && n[deep-2] == 2){
int max = 1;
for(k = 0; k < number-deep; k++) max *= 2;
count += max;
return 0;
}
if(deep < number)
tdo(deep+1);
}
return 0;
}

BIN
23/problem.build Normal file

Binary file not shown.

0
23/problem.set Normal file
View File

1
23/stdin Normal file
View File

@ -0,0 +1 @@
8

1
23/stdout Normal file
View File

@ -0,0 +1 @@
107

24
24.1/main.c Normal file
View File

@ -0,0 +1,24 @@
#include <stdio.h>
int main(void){
unsigned long long n, c = 0, x, pow = 1, lx = 0;
scanf("%llu",&n);
while(n){ //当n不等于0的时候才继续循环
x = n % 10; //将n现在的最低位赋值给x
n /= 10;
if(n){//当n不等于0的时候,就是判断现在的处理的位是否到了最后一位
if(x == 1){
c += (lx+1) + n * pow; //总数加上现在的位上出现1的次数
}
else c += (x>0?n+1:n) * pow; //同上
}
else if(x < 2)
c += lx+1;
else c += pow;
lx += x * pow;//记录x位后面的位作为以后x=1的时候的计算依据
pow *= 10;
}
printf("%llu\n",c);
return 0;
}

BIN
24.1/problem.build Normal file

Binary file not shown.

0
24.1/problem.set Normal file
View File

1
24.1/stdin Normal file
View File

@ -0,0 +1 @@
10000000000

1
24.1/stdout Normal file
View File

@ -0,0 +1 @@
10000000001

25
24/main.c Normal file
View File

@ -0,0 +1,25 @@
#include <stdio.h>
int n[10] = {0};
unsigned long long count = 0;
int add(int *n);
int main(void){
unsigned long long i,number;
scanf("%llu",&number);
for(i = 0; i < number; i++)
add(n);
printf("%llu\n",count);
return 0;
}
int add(int *n){
int i = 0;
n[0] += 1;
while(n[i] > 9){
n[i] %= 10;
n[++i] += 1;
}
for(i = 0; i < 10; i++)
if(n[i] == 1) count++;
return 0;
}

BIN
24/problem.build Normal file

Binary file not shown.

0
24/problem.set Normal file
View File

1
24/stdin Normal file
View File

@ -0,0 +1 @@
6342

1
24/stdout Normal file
View File

@ -0,0 +1 @@
2975

12
25/main.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
int main(void){
unsigned long long n,m,i;
double sum = 0.0;
scanf("%llu %llu",&n,&m);
for(i = n; i <= m; i++){
sum += 1.0/(i*i);
}
printf("%.5lf\n",sum);
return 0;
}

BIN
25/problem.build Normal file

Binary file not shown.

0
25/problem.set Normal file
View File

1
25/stdin Normal file
View File

@ -0,0 +1 @@
2 4

1
25/stdout Normal file
View File

@ -0,0 +1 @@
0.42361

15
26/main.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
int main(void){
int i,t;
scanf("%d",&t);
unsigned long long t_a,t_b,a = 1, b = 0;
for(i = 0; i < t; i++){
t_a = 3 * a;
t_b = 2 * b;
a = b;
b = t_a + t_b;
}
printf("%llu %llu\n",a,b);
return 0;
}

BIN
26/problem.build Normal file

Binary file not shown.

0
26/problem.set Normal file
View File

1
26/stdin Normal file
View File

@ -0,0 +1 @@
6

1
26/stdout Normal file
View File

@ -0,0 +1 @@
183 546

30
27/main.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <math.h>
int main(void){
unsigned long long bgn = 1671700,i;
int num, count = 0;
scanf("%d",&num);
while(count < num){
bgn += 100;
int aly = 1;
unsigned long long k, n_bgn = bgn + 99;
for(i = bgn; i <= n_bgn; i++){
unsigned long long sqri = sqrt(i) + 1;
int kaly = 0;
for(k = 2; k <= sqri; k++){
if(!(i % k)){
kaly = 1;
break;
}
}
if(!kaly){
aly = 0;
break;
}
}
if(aly) count++;
}
printf("%llu %llu\n",bgn,bgn+99);
return 0;
}

BIN
27/problem.build Normal file

Binary file not shown.

0
27/problem.set Normal file
View File

1
27/stdin Normal file
View File

@ -0,0 +1 @@
1

1
27/stdout Normal file
View File

@ -0,0 +1 @@
1671800 1671899

18
28/main.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
int main(void){
int a,b,i = 0,k = 1;
double sum = 0.0, temp = 1.0;
scanf("%d %d",&a,&b);
while(sum <= a){
sum += 1.0/temp;
temp += 1.0/++k;
}
printf("%d ",k-1);
while(sum < b){
sum += 1.0/temp;
temp += 1.0/++k;
}
printf("%d\n",k-2);
return 0;
}

BIN
28/problem.build Normal file

Binary file not shown.

0
28/problem.set Normal file
View File

1
28/stdin Normal file
View File

@ -0,0 +1 @@
2010 2011

1
28/stdout Normal file
View File

@ -0,0 +1 @@
18611 18621

28
29/main.c Normal file
View File

@ -0,0 +1,28 @@
#include <stdio.h>
int if_has(int i,int m);
int main(void){
unsigned long long m,n,i,bgn = 1, aft = 9,sum = 0,g = 0;
scanf("%llu %llu",&m,&n);
for(i = 0; i < n-1; i++) bgn *= 10;
for(i = 0; i < n-1;i++){
aft *= 10;
aft += 9;
}
printf("%llu %llu\n",bgn ,aft);
for(i = bgn; i <= aft; i++){
if(if_has(i,m) && i%m){
g++;
sum += i;
}
}
printf("%llu %llu",g,sum);
return 0;
}
int if_has(int i,int m){
while(i > 0){
if(m == i%10) return 1;
i/=10;
}
return 0;
}

BIN
29/problem.build Normal file

Binary file not shown.

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.problem.build</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

0
29/problem.set Normal file
View File

1
29/stdin Normal file
View File

@ -0,0 +1 @@
7 5

2
29/stdout Normal file
View File

@ -0,0 +1,2 @@
10000 99999
32152 1894711910

19
30/31/main.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
int rmb[6] = {100, 50, 10, 5, 2, 1};
int main(void){
int numbers = 0,ac[100];
scanf("%d",&numbers);
int temp, i, all = 0, count;
for(i = 0; i < numbers; i++) scanf("%d",&ac[i]);
for(i = 0; i < numbers; i++){
temp = ac[i];
for(count = 0; count < 6; count++){
all += temp / rmb[count];
temp %= rmb[count];
}
}
printf("%d\n",all);
return 0;
}

BIN
30/31/problem.build Normal file

Binary file not shown.

0
30/31/problem.set Normal file
View File

2
30/31/stdin Normal file
View File

@ -0,0 +1,2 @@
3
1 2 3

1
30/31/stdout Normal file
View File

@ -0,0 +1 @@
4

18
30/main.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
int main(void){
double x;
unsigned long long k,y;
scanf("%llu",&k);
for(y = k; y < 9999999999999; y++){
x = k*y/(double)(y-k);
if(x < y) break;
if(x - (int)x < 10e-6){
unsigned long long b,s;
b = x>y?x:y;
s = x<y?x:y;
printf("1/%llu=1/%llu+1/%llu\n",k,b,s);
}
}
return 0;
}

BIN
30/problem.build Normal file

Binary file not shown.

0
30/problem.set Normal file
View File

1
30/stdin Normal file
View File

@ -0,0 +1 @@
4

3
30/stdout Normal file
View File

@ -0,0 +1,3 @@
1/4=1/20+1/5
1/4=1/12+1/6
1/4=1/8+1/8

23
32/main.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
int main(void){
int value;
int n,temp,i,k;
scanf("%d %d",&value,&n);
for(i = (n>0)?n:-(n); i > 0; i--){
if(n < 0){
temp = value & 2147483648;
value <<= 1;
if(temp == -2147483648)
value += 1;
}
else if(n > 0){
temp = value & 1;
value >>= 1;
if(temp)
value += 2147483648;
}
}
printf("%d\n",value);
return 0;
}

BIN
32/problem.build Normal file

Binary file not shown.

0
32/problem.set Normal file
View File

1
32/stdin Normal file
View File

@ -0,0 +1 @@
134744064 -8

1
32/stdout Normal file
View File

@ -0,0 +1 @@
134742024

14
33/main.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
int main(void){
int a,b,number;
scanf("%d",&number);
int i;
for(i = 0; i< number; i++){
scanf("%d %d",&a,&b);
a %= 100;
b %= 100;
printf("%d\n",(a+b)%100);
}
return 0;
}

BIN
33/problem.build Normal file

Binary file not shown.

0
33/problem.set Normal file
View File

3
33/stdin Normal file
View File

@ -0,0 +1,3 @@
2
35 80
15 1152

2
33/stdout Normal file
View File

@ -0,0 +1,2 @@
15
67

10
34/main.c Normal file
View File

@ -0,0 +1,10 @@
#include <stdio.h>
#include <math.h>
int main(void){
double a, b;
scanf("%lf %lf",&a,&b);
sum = atan(b) - atan(a);
printf("%.6lf",sum);
return 0;
}

BIN
34/problem.build Normal file

Binary file not shown.

0
34/problem.set Normal file
View File

1
34/stdin Normal file
View File

@ -0,0 +1 @@
0.5 1

1
34/stdout Normal file
View File

@ -0,0 +1 @@
0.321751

19
35/main.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
#define TH(x) ((x)*(x))
int main(void){
int number,i;
double avg,temp[33000];
scanf("%d",&number);
for(i = 0 ;i < number; i++){
scanf("%lf",&temp[i]);
avg += temp[i];
}
avg /= number;
double s = 0.0;
for(i = 0; i < number; i++){
s += TH(temp[i] - avg);
}
printf("%.6lf\n",s);
return 0;
}

BIN
35/problem.build Normal file

Binary file not shown.

0
35/problem.set Normal file
View File

2
35/stdin Normal file
View File

@ -0,0 +1,2 @@
5
1 2 3 4 5

1
35/stdout Normal file
View File

@ -0,0 +1 @@
10.000000

17
36/main.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
int main(void){
long a, b, i;
scanf("%ld %ld",&a,&b);
long sum = 0;
int if_yes = 0;
for(i = 1; i < a; i++)
if(!(a % i)) sum += i;
if(sum == b) if_yes = 1;
for(i = 1, sum = 0; i < b; i++)
if(!(b % i)) sum += i;
if(sum == a && if_yes) printf("YES\n");
else printf("NO\n");
return 0;
}

BIN
36/problem.build Normal file

Binary file not shown.

0
36/problem.set Normal file
View File

1
36/stdin Normal file
View File

@ -0,0 +1 @@
220 284

1
36/stdout Normal file
View File

@ -0,0 +1 @@
YES

Some files were not shown because too many files have changed in this diff Show More