UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#186802#3351. 霜冻碎片quliannanyishou10042ms1368kbC++11247b2023-10-01 12:28:532023-10-01 12:49:59

answer

#include<iostream>
int m,n,a[210][210],s,x,y,i,j;
main(){
	std::cin>>m>>n;
	y=m%3==0?1:2;
	x=n%3==0?1:2;
	while(i++<m){
		j=0;
		while(j++<n){
			std::cin>>a[i][j];
			s+=(i+y)%3==0&&(j+x)%3==0?a[i][j]:0;
		}
	}
	std::cout<<s;   
}

详细

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

Test #1:

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

input:

2 10
4 5 4 4 4 4 2 2 1 1
4 5 4 4 4 4 2 2 1 1

output:

11

result:

ok 1 number(s): "11"

Test #2:

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

input:

3 6
2 2 2 3 3 1
3 4 3 5 5 3
2 3 2 4 4 3

output:

9

result:

ok 1 number(s): "9"

Test #3:

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

input:

4 5
3 4 4 4 3
4 6 5 5 3
5 7 6 6 4
3 5 4 4 2

output:

14

result:

ok 1 number(s): "14"

Test #4:

score: 10
Accepted
time: 6ms
memory: 1360kb

input:

191 182
2 2 3 2 2 1 1 1 1 0 2 2 3 1 1 1 3 5 4 3 2 3 2 1 1 2 3 4 3 2 2 3 4 3 2 2 2 4 4 5 5 6 5 3 2 2 ...

output:

17471

result:

ok 1 number(s): "17471"

Test #5:

score: 10
Accepted
time: 6ms
memory: 1356kb

input:

189 187
3 5 5 5 4 4 4 5 5 3 2 2 3 2 1 1 2 4 4 3 2 2 4 4 4 2 3 2 4 3 4 4 4 3 3 4 6 5 5 5 4 4 4 5 5 5 ...

output:

17802

result:

ok 1 number(s): "17802"

Test #6:

score: 10
Accepted
time: 6ms
memory: 1352kb

input:

181 187
1 2 4 4 3 3 4 5 4 3 3 3 4 5 4 2 1 1 2 2 4 4 4 2 2 2 4 4 4 4 4 5 3 2 0 2 3 3 2 1 2 2 2 2 1 3 ...

output:

16786

result:

ok 1 number(s): "16786"

Test #7:

score: 10
Accepted
time: 6ms
memory: 1368kb

input:

200 197
4 5 3 2 2 3 3 3 4 4 4 3 4 5 5 4 3 3 2 2 2 3 3 4 5 5 3 2 2 3 2 2 2 2 2 1 3 2 3 2 3 3 3 2 1 1 ...

output:

19623

result:

ok 1 number(s): "19623"

Test #8:

score: 10
Accepted
time: 6ms
memory: 1360kb

input:

196 184
2 2 2 3 4 4 3 4 4 3 2 2 3 2 1 2 4 4 4 3 4 3 2 1 1 3 4 3 2 3 5 6 5 4 3 3 4 3 3 2 4 4 4 2 2 2 ...

output:

18159

result:

ok 1 number(s): "18159"

Test #9:

score: 10
Accepted
time: 6ms
memory: 1356kb

input:

185 192
4 5 4 2 2 1 3 3 3 2 1 1 1 1 2 3 5 6 6 5 5 5 6 4 2 2 3 5 5 6 5 4 3 3 3 3 3 3 4 3 3 1 2 3 5 4 ...

output:

17796

result:

ok 1 number(s): "17796"

Test #10:

score: 10
Accepted
time: 6ms
memory: 1356kb

input:

192 185
3 3 2 2 4 4 4 3 2 2 2 3 4 3 3 1 1 0 2 3 5 5 4 3 2 4 4 4 3 3 3 4 4 3 2 2 4 4 5 3 3 2 2 2 1 3 ...

output:

17644

result:

ok 1 number(s): "17644"