結果
問題 | No.607 開通777年記念 |
ユーザー | GrayCoder |
提出日時 | 2017-12-07 22:14:17 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 104 ms |
コンパイル使用メモリ | 10,756 KB |
実行使用メモリ | 92,968 KB |
最終ジャッジ日時 | 2023-08-19 12:28:24 |
合計ジャッジ時間 | 4,172 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 13 ms
12,220 KB |
testcase_01 | AC | 13 ms
7,800 KB |
testcase_02 | AC | 13 ms
7,900 KB |
testcase_03 | AC | 13 ms
7,788 KB |
testcase_04 | AC | 14 ms
7,804 KB |
testcase_05 | AC | 14 ms
7,908 KB |
testcase_06 | AC | 14 ms
7,792 KB |
testcase_07 | AC | 114 ms
14,824 KB |
testcase_08 | AC | 14 ms
7,748 KB |
testcase_09 | AC | 32 ms
8,968 KB |
testcase_10 | AC | 20 ms
8,880 KB |
testcase_11 | TLE | - |
testcase_12 | -- | - |
ソースコード
def main(): N, M = map(int, input().split()) A = [list(map(int, input().split())) for _ in [0] * M] a = [[0 for _ in [0] * (N + 1)] for _ in [0] * (M + 1)] for j in range(N): for i in range(M): a[i+1][j+1] = A[i][j] + a[i][j+1] for i in range(M): a[i+1][j+1] += a[i+1][j] for i in range(1, M + 1): if max(a[i]) < 777: continue elif 777 in a[i]: print('YES') break j = N while j > 0: x = a[i][j] - 777 if x in a[i]: print('YES') return j -= 1 else: print('NO') main()