結果

問題 No.361 門松ゲーム2
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-14 02:32:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 436 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 957 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 77,116 KB
最終ジャッジ日時 2023-09-08 11:29:28
合計ジャッジ時間 7,613 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,788 KB
testcase_01 AC 73 ms
71,008 KB
testcase_02 AC 76 ms
70,868 KB
testcase_03 AC 74 ms
71,004 KB
testcase_04 AC 74 ms
70,864 KB
testcase_05 AC 73 ms
71,040 KB
testcase_06 AC 73 ms
70,724 KB
testcase_07 AC 75 ms
70,756 KB
testcase_08 AC 105 ms
76,128 KB
testcase_09 AC 100 ms
76,228 KB
testcase_10 AC 100 ms
76,128 KB
testcase_11 AC 86 ms
75,896 KB
testcase_12 AC 101 ms
76,080 KB
testcase_13 AC 100 ms
76,028 KB
testcase_14 AC 284 ms
76,724 KB
testcase_15 AC 125 ms
76,652 KB
testcase_16 AC 361 ms
76,636 KB
testcase_17 AC 331 ms
76,668 KB
testcase_18 AC 131 ms
76,504 KB
testcase_19 AC 340 ms
76,728 KB
testcase_20 AC 114 ms
76,128 KB
testcase_21 AC 331 ms
76,584 KB
testcase_22 AC 436 ms
76,712 KB
testcase_23 AC 254 ms
77,116 KB
testcase_24 AC 378 ms
76,816 KB
testcase_25 AC 395 ms
76,648 KB
testcase_26 AC 399 ms
76,736 KB
testcase_27 AC 395 ms
76,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,D=map(int,input().split())
dp=[0]*(L+1)
for i in range(1,L+1):
    st={10000}
    for j in range(1,i):
        for k in range(1,j):
            l=i-j-k
            if l==j or l==k:
                continue
            if l<=0:
                continue
            if max(j,k,l)-min(j,k,l)>D:
                continue
            st.add(dp[j]^dp[k]^dp[l])
    lt=list(st)
    list.sort(lt)
    for j in range(len(lt)):
        if lt[j]!=j:
            dp[i]=j
            break
if dp[L]:
    print('kado')
else :
    print('matsu')
0