結果
問題 | No.607 開通777年記念 |
ユーザー | k1832 |
提出日時 | 2021-07-01 18:05:53 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 458 ms |
コンパイル使用メモリ | 87,132 KB |
実行使用メモリ | 98,996 KB |
最終ジャッジ日時 | 2023-09-10 15:51:12 |
合計ジャッジ時間 | 8,353 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
75,692 KB |
testcase_01 | AC | 69 ms
71,264 KB |
testcase_02 | AC | 67 ms
71,428 KB |
testcase_03 | AC | 68 ms
71,352 KB |
testcase_04 | AC | 70 ms
71,228 KB |
testcase_05 | AC | 70 ms
71,428 KB |
testcase_06 | AC | 71 ms
71,388 KB |
testcase_07 | AC | 225 ms
79,016 KB |
testcase_08 | AC | 73 ms
71,388 KB |
testcase_09 | AC | 87 ms
76,608 KB |
testcase_10 | AC | 82 ms
76,676 KB |
testcase_11 | TLE | - |
testcase_12 | TLE | - |
ソースコード
# Should not work in the time limit. N, M = list(map(int, input().split())) inc_dec = [] for _ in range(M): inc_dec.append(list(map(int, input().split()))) cum_sum = [[0] * (N+1) for _ in range(M+1)] for i in range(M): for j in range(N): cum_sum[i+1][j+1] = cum_sum[i][j+1] + cum_sum[i+1][j] - cum_sum[i][j] + inc_dec[i][j] for end_y in range(1, M+1): for start_x in range(N): for end_x in range(start_x+1, N+1): if cum_sum[end_y][end_x] - cum_sum[end_y][start_x] == 777: print('YES') exit() print('NO')