Submission #00364
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #include "stdio.h" #include <algorithm> using namespace std; int H; int W; int A[1001][1001]; int sa; int ans = 0; int main() { scanf ( "%d" , &H); scanf ( "%d" , &W); for ( int i = 0; i < H; i++) { for ( int j = 0; j < W; j++) { scanf ( "%d" , &A[i][j]); } } for ( int i = 0; i < H-1; i++) { for ( int j = 0; j < W-1; j++) { sa = A[i][j]; if (sa == A[i + 1][j]) { if (sa == A[i + 1][j + 1]) { if (sa == A[i][j + 1]) { ans++; } } } } } printf ( "%d\n" , ans); return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0003 - picnic |
ユーザー名 | Domae |
投稿日時 | 2017-11-26 14:53:02 |
言語 | C++17 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 554 Byte |
最大実行時間 | 81 ms |
最大メモリ使用量 | 4552 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
!test_01.txt | AC | 21 ms | 480 KB |
1
|
!test_02.txt | AC | 23 ms | 440 KB |
1
|
random_01.txt | AC | 81 ms | 4240 KB |
1
|
random_02.txt | AC | 44 ms | 4280 KB |
1
|
random_03.txt | AC | 43 ms | 2396 KB |
1
|
random_04.txt | AC | 60 ms | 4396 KB |
1
|
random_05.txt | AC | 64 ms | 4436 KB |
1
|
random_06.txt | AC | 57 ms | 4472 KB |
1
|
random_07.txt | AC | 64 ms | 4512 KB |
1
|
random_08.txt | AC | 57 ms | 4552 KB |
1
|