結果
問題 | No.607 開通777年記念 |
ユーザー | Ryuto |
提出日時 | 2017-12-11 13:46:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,150 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 50,944 KB |
最終ジャッジ日時 | 2024-11-30 11:38:23 |
合計ジャッジ時間 | 3,812 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#!/usr/bin/env python nm = [int(x) for x in input().split()] indats = [] for i in range(nm[1]): tmpl = [int(x) for x in input().split()] indats.append(tmpl) npax = [0 for x in range(nm[0])] for indat in indats: if sum([x**2 for x in indat]) == 0: continue npax = [x + y for (x, y) in zip(npax, indat)] for i in range(nm[0]): sumpax = 0 for j in range(nm[0]-i): sumpax += npax[i+j] if sumpax == 777: print('YES') exit() elif sumpax > 777: break print('NO')