結果

問題 No.607 開通777年記念
ユーザー syunsukesyunsuke
提出日時 2018-07-29 17:34:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 659 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 8,332 KB
最終ジャッジ日時 2023-09-25 07:15:55
合計ジャッジ時間 4,123 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,332 KB
testcase_01 AC 17 ms
7,848 KB
testcase_02 AC 16 ms
8,160 KB
testcase_03 AC 16 ms
8,204 KB
testcase_04 AC 15 ms
7,832 KB
testcase_05 AC 16 ms
8,088 KB
testcase_06 AC 16 ms
8,168 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
NM=input()
NM=NM.rstrip().split(" ")
N=int(NM[0])
M=int(NM[1])

list1=[0 for i in range(N)]

for j in range(M):
    L=input()
    L=L.rstrip().split(" ")
    for k in range(N):
        list1[k]+=int(L[k])
        ans=0
        num=0
        NUM=0
        for l in range(1000000000000):
            if ans==777:
                print("YES")
                exit()
            elif ans>777:
                ans=ans-list1[NUM]
                NUM+=1
            elif ans<777:
                if num==N:
                    break
                else:
                    ans=ans+list1[num]
                    num+=1
print("NO")
0