UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#194768#1154. 统计满足条件的4位数个数yzgl1002ms1252kbC++344b2023-10-17 19:34:422023-10-17 19:34:42

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int a[110];
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	int s=0;
	for(int i=1;i<=n;i++){
		int x=a[i]/1000;
		int y=a[i]/100%10;
		int z=a[i]/10%10;
		int q=a[i]%10;
		if(q-x-y-z>0){
			s++;
		}
	}
	cout<<s;
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1248kb

input:

60
1219 7537 1228 1209 9480 8067 1009 6763 7210 2019 8668 5281 0229 5655 1025 2329 7718 5372 0109 67...

output:

28

result:

ok single line: '28'

Test #2:

score: 10
Accepted
time: 0ms
memory: 1248kb

input:

28
1019 10336 1800 0019 4320 6567 2219 2018 2329 2309 2045 3553 2319 4190 1153 1029 6876 2932 1209 1...

output:

12

result:

ok single line: '12'

Test #3:

score: 10
Accepted
time: 1ms
memory: 1248kb

input:

4
2209 8055 4372 0019

output:

2

result:

ok single line: '2'

Test #4:

score: 10
Accepted
time: 0ms
memory: 1248kb

input:

90
2029 8928 2195 1019 8868 1336 1129 8231 6466 0129 3737 1727 1129 9546 3897 2229 6660 1751 1129 53...

output:

31

result:

ok single line: '31'

Test #5:

score: 10
Accepted
time: 0ms
memory: 1244kb

input:

9
2009 10757 5176 0009 1091 9799 1219 10377 4509

output:

3

result:

ok single line: '3'

Test #6:

score: 10
Accepted
time: 0ms
memory: 1252kb

input:

30
0029 5568 2798 0019 1280 8613 1209 4202 9092 0029 8586 6210 2119 8141 4515 1029 9172 5838 0129 86...

output:

10

result:

ok single line: '10'

Test #7:

score: 10
Accepted
time: 0ms
memory: 1244kb

input:

3
2129 1554 5875

output:

1

result:

ok single line: '1'

Test #8:

score: 10
Accepted
time: 0ms
memory: 1248kb

input:

2
2209 2149

output:

2

result:

ok single line: '2'

Test #9:

score: 10
Accepted
time: 1ms
memory: 1252kb

input:

67
0129 5366 1034 1219 9375 9117 2329 8975 6476 1119 6344 5068 2209 7576 7133 2029 6165 7213 2009 72...

output:

27

result:

ok single line: '27'

Test #10:

score: 10
Accepted
time: 0ms
memory: 1252kb

input:

42
1019 6240 10974 2109 9999 2625 2109 6867 7580 0019 5189 6344 2229 6633 3740 2329 3661 5230 0029 2...

output:

16

result:

ok single line: '16'