結果
問題 | No.1376 Simple LPS Problem |
ユーザー | chineristAC |
提出日時 | 2021-02-05 23:17:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,393 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 72,320 KB |
最終ジャッジ日時 | 2024-07-02 14:30:29 |
合計ジャッジ時間 | 9,587 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 47 ms
54,016 KB |
testcase_02 | AC | 46 ms
54,272 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 46 ms
54,144 KB |
testcase_06 | WA | - |
testcase_07 | AC | 46 ms
54,272 KB |
testcase_08 | AC | 46 ms
54,528 KB |
testcase_09 | WA | - |
testcase_10 | AC | 46 ms
54,400 KB |
testcase_11 | WA | - |
testcase_12 | AC | 45 ms
54,272 KB |
testcase_13 | WA | - |
testcase_14 | AC | 46 ms
54,400 KB |
testcase_15 | WA | - |
testcase_16 | AC | 46 ms
54,400 KB |
testcase_17 | AC | 47 ms
54,272 KB |
testcase_18 | WA | - |
testcase_19 | AC | 47 ms
54,016 KB |
testcase_20 | WA | - |
testcase_21 | AC | 46 ms
54,016 KB |
testcase_22 | WA | - |
testcase_23 | AC | 46 ms
54,016 KB |
testcase_24 | WA | - |
testcase_25 | AC | 46 ms
54,144 KB |
testcase_26 | AC | 47 ms
54,400 KB |
testcase_27 | AC | 47 ms
54,400 KB |
testcase_28 | AC | 46 ms
54,656 KB |
testcase_29 | WA | - |
testcase_30 | AC | 46 ms
54,016 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 46 ms
54,400 KB |
testcase_35 | WA | - |
testcase_36 | AC | 46 ms
54,400 KB |
testcase_37 | WA | - |
testcase_38 | AC | 46 ms
54,656 KB |
testcase_39 | AC | 46 ms
54,656 KB |
testcase_40 | AC | 46 ms
54,400 KB |
testcase_41 | AC | 48 ms
54,400 KB |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | AC | 47 ms
54,272 KB |
testcase_45 | AC | 56 ms
64,256 KB |
testcase_46 | AC | 64 ms
72,320 KB |
testcase_47 | AC | 60 ms
68,480 KB |
testcase_48 | AC | 63 ms
70,912 KB |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | AC | 45 ms
54,400 KB |
testcase_56 | AC | 46 ms
54,656 KB |
testcase_57 | AC | 47 ms
54,400 KB |
testcase_58 | AC | 58 ms
65,408 KB |
testcase_59 | WA | - |
testcase_60 | AC | 46 ms
54,272 KB |
testcase_61 | AC | 46 ms
54,144 KB |
ソースコード
import random def test(): res = [1,0,1,0,1] while True: ok = [True,True] n = len(res) if res[n-1]==res[n-4] and res[n-2]==res[n-3]: ok[res[n-5]] = False if n>=6 and res[n-1]==res[n-5] and res[n-2]==res[n-4]: ok[res[n-6]] = False if all(res[i]==1 for i in range(n-4,n)) and res[n-5]==0: ok[1] = False if all(res[i]==0 for i in range(n-4,n)) and res[n-5]==1: ok[0] = False if ok[0]: if not ok[1]: res.append(0) else: res.append(random.randint(0,99)%2) elif ok[1]: res.append(1) else: break return res def test_p(N): res = [1,0,1,0,1,0,1] while True: res += [0,0,1,1,0,1] for n in range(len(res),len(res)-6,-1): for j in range((N+1)//2): if res[n-j-1]!=res[n-(N+1)+j]: break else: assert False for j in range((N+1)//2): if res[n-j-1]!=res[n-(N+2)+j]: break else: assert False if len(res) > 100: break return res def test_3(): res = [1,0,1] while True: ok = [True,True] n = len(res) if res[n-1]==res[n-2]: ok[res[n-3]] = False if n>=4 and res[n-1]==res[n-3]: ok[res[n-4]] = False if ok[0]: if not ok[1]: res.append(0) else: res.append(random.randint(0,99)%2) elif ok[1]: res.append(1) else: break return res M = 0 case = 0 s = "" while case: r = test_p(7) if len(r) > M: M = len(r) s = r #M = max(M,len(r)) case -= 1 #print(M) #print(s) N,K = map(int,input().split()) if K%2==1: if K==1: if N==1: print(1) else: print(-1) elif K==3: if N<=8: s = [0,0,0,1,0,1,1,1] s = s[:N] for i in range(N): s[i] = str(s[i]) print("".join(s)) else: print(-1) else: s = [1-(i%2) for i in range(K)] s += [0,0,1,1,0,1] * (N//5 + 1) s = s[:N] for i in range(N): s[i] = str(s[i]) print("".join(s))