結果
問題 | No.607 開通777年記念 |
ユーザー |
|
提出日時 | 2017-12-30 15:57:03 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 1,535 ms / 2,000 ms |
コード長 | 480 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 7,204 KB |
実行使用メモリ | 38,912 KB |
最終ジャッジ日時 | 2024-12-21 13:20:40 |
合計ジャッジ時間 | 5,146 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#yuki_607 import sys n,m=map(int,raw_input().split()) a=[] for i in xrange(m): b=map(int,raw_input().split()) a.append(b) c=a[0] l,r=0,1 for i in range(n*2): s=sum(c[l:r]) if s==777: print 'YES' exit() elif s<777: r+=1 else: l+=1 if r>n: continue for i in xrange(1,m): for j in xrange(n): c[j]+=a[i][j] l,r=0,1 for i in range(n*2): s=sum(c[l:r]) if s==777: print 'YES' exit() elif s<777: r+=1 else: l+=1 if r>n: continue print 'NO'