結果

問題 No.361 門松ゲーム2
ユーザー yaoshimaxyaoshimax
提出日時 2016-04-19 23:05:57
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,829 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 6,748 KB
実行使用メモリ 6,264 KB
最終ジャッジ日時 2023-09-07 01:37:14
合計ジャッジ時間 13,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,944 KB
testcase_01 AC 12 ms
5,924 KB
testcase_02 AC 11 ms
5,948 KB
testcase_03 AC 11 ms
5,864 KB
testcase_04 AC 12 ms
5,940 KB
testcase_05 AC 12 ms
5,860 KB
testcase_06 AC 11 ms
5,888 KB
testcase_07 AC 11 ms
5,852 KB
testcase_08 AC 18 ms
5,948 KB
testcase_09 AC 20 ms
6,052 KB
testcase_10 AC 16 ms
5,936 KB
testcase_11 AC 12 ms
6,068 KB
testcase_12 AC 17 ms
5,888 KB
testcase_13 AC 17 ms
5,948 KB
testcase_14 AC 935 ms
6,212 KB
testcase_15 AC 86 ms
5,912 KB
testcase_16 AC 1,026 ms
5,972 KB
testcase_17 AC 781 ms
6,108 KB
testcase_18 AC 140 ms
6,000 KB
testcase_19 AC 800 ms
6,000 KB
testcase_20 AC 60 ms
6,080 KB
testcase_21 AC 949 ms
6,140 KB
testcase_22 AC 1,829 ms
6,264 KB
testcase_23 AC 936 ms
5,896 KB
testcase_24 AC 938 ms
5,992 KB
testcase_25 AC 948 ms
5,988 KB
testcase_26 AC 1,018 ms
5,948 KB
testcase_27 AC 1,041 ms
6,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,D=map(int,raw_input().split())

ans=[0 for i in range(L+1)]
for i in range(6,L+1):
    grundies=[]
    for j in range(1,i+1):
        for k in range(j+1,i+1):
            l=i-j-k
            if l<=k: 
                break
            if l-j > D:
                continue
            num=ans[j]^ans[k]^ans[l]
            grundies.append(num)
    grundies=set(grundies)
    while True:
        if ans[i] not in grundies:
            break
        ans[i]+=1
if ans[L]==0:
    print "matsu"
else:
    print "kado"
0