結果
問題 | No.2278 Time Bomb Game 2 |
ユーザー | shotoyoo |
提出日時 | 2023-04-21 22:13:37 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,942 bytes |
コンパイル時間 | 238 ms |
コンパイル使用メモリ | 82,068 KB |
実行使用メモリ | 89,916 KB |
最終ジャッジ日時 | 2024-11-06 17:05:09 |
合計ジャッジ時間 | 7,017 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 46 ms
54,400 KB |
testcase_01 | AC | 45 ms
54,144 KB |
testcase_02 | AC | 45 ms
54,272 KB |
testcase_03 | AC | 44 ms
54,144 KB |
testcase_04 | AC | 44 ms
54,400 KB |
testcase_05 | AC | 45 ms
54,528 KB |
testcase_06 | AC | 57 ms
66,048 KB |
testcase_07 | AC | 67 ms
78,540 KB |
testcase_08 | AC | 64 ms
74,112 KB |
testcase_09 | AC | 81 ms
86,144 KB |
testcase_10 | AC | 79 ms
83,456 KB |
testcase_11 | AC | 70 ms
81,152 KB |
testcase_12 | AC | 61 ms
72,832 KB |
testcase_13 | AC | 83 ms
85,852 KB |
testcase_14 | AC | 70 ms
82,432 KB |
testcase_15 | AC | 81 ms
87,552 KB |
testcase_16 | AC | 68 ms
79,488 KB |
testcase_17 | AC | 65 ms
75,008 KB |
testcase_18 | AC | 70 ms
80,128 KB |
testcase_19 | AC | 69 ms
80,128 KB |
testcase_20 | AC | 60 ms
74,220 KB |
testcase_21 | AC | 56 ms
71,984 KB |
testcase_22 | AC | 56 ms
72,892 KB |
testcase_23 | AC | 69 ms
82,976 KB |
testcase_24 | AC | 82 ms
87,944 KB |
testcase_25 | AC | 69 ms
81,944 KB |
testcase_26 | AC | 67 ms
80,352 KB |
testcase_27 | AC | 83 ms
86,232 KB |
testcase_28 | AC | 63 ms
77,036 KB |
testcase_29 | AC | 67 ms
81,716 KB |
testcase_30 | AC | 67 ms
80,172 KB |
testcase_31 | AC | 60 ms
74,592 KB |
testcase_32 | AC | 65 ms
78,820 KB |
testcase_33 | AC | 67 ms
79,224 KB |
testcase_34 | AC | 71 ms
82,724 KB |
testcase_35 | AC | 86 ms
86,860 KB |
testcase_36 | AC | 64 ms
77,988 KB |
testcase_37 | AC | 66 ms
79,756 KB |
testcase_38 | AC | 67 ms
79,156 KB |
testcase_39 | AC | 85 ms
89,916 KB |
testcase_40 | AC | 64 ms
73,424 KB |
testcase_41 | AC | 69 ms
82,080 KB |
testcase_42 | AC | 59 ms
71,552 KB |
testcase_43 | AC | 68 ms
80,640 KB |
testcase_44 | AC | 62 ms
73,216 KB |
testcase_45 | AC | 65 ms
76,928 KB |
testcase_46 | AC | 63 ms
74,240 KB |
testcase_47 | AC | 81 ms
84,312 KB |
testcase_48 | AC | 86 ms
86,528 KB |
testcase_49 | AC | 70 ms
81,008 KB |
testcase_50 | AC | 63 ms
75,392 KB |
testcase_51 | AC | 70 ms
81,280 KB |
testcase_52 | AC | 61 ms
72,960 KB |
testcase_53 | AC | 69 ms
81,024 KB |
testcase_54 | AC | 64 ms
74,112 KB |
testcase_55 | AC | 64 ms
76,032 KB |
testcase_56 | AC | 58 ms
71,168 KB |
testcase_57 | AC | 65 ms
78,336 KB |
testcase_58 | AC | 61 ms
73,088 KB |
testcase_59 | AC | 69 ms
82,560 KB |
testcase_60 | AC | 71 ms
82,432 KB |
testcase_61 | AC | 63 ms
74,752 KB |
testcase_62 | AC | 78 ms
83,456 KB |
testcase_63 | AC | 59 ms
72,576 KB |
testcase_64 | AC | 61 ms
72,960 KB |
testcase_65 | AC | 61 ms
72,448 KB |
testcase_66 | AC | 62 ms
73,216 KB |
testcase_67 | AC | 62 ms
72,320 KB |
testcase_68 | AC | 63 ms
72,192 KB |
testcase_69 | AC | 61 ms
73,216 KB |
testcase_70 | AC | 60 ms
71,552 KB |
testcase_71 | WA | - |
ソースコード
import sys, random input = lambda : sys.stdin.readline().rstrip() write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x)) debug = lambda x: sys.stderr.write(x+"\n") YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18 LI = lambda : list(map(int, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()] def debug(_l_): for s in _l_.split(): print(f"{s}={eval(s)}", end=" ") print() def dlist(*l, fill=0): if len(l)==1: return [fill]*l[0] ll = l[1:] return [dlist(*ll, fill=fill) for _ in range(l[0])] def runlength(s): if not s: return [] c = s[0] v = 1 n = len(s) l = [] for i in range(1, n): if c==s[i]: v += 1 else: l.append((c,v)) c = s[i] v = 1 l.append((c,v)) return l n,k,t = list(map(int, input().split())) k -= 1 c = input() c = [cc=="A" for cc in c] res = runlength(c) f = c[k] def sub(index): i0 = i1 = INF for i in index: if c[i]==f: if i0==INF: continue else: i1 = i break else: if i0==INF: i0 = i return i0,i1 i0,i1 = sub(list(range(k,n))) j0,j1 = sub(list(range(k+1))[::-1]) if j0==INF: l = 0 else: l = j0+1 r = min(i0,n) d = r-l if d>=2: if i0<INF and t>=abs(k-i0) and (t+k+i0)%2==0: res = 1 elif j0!=INF and t>=abs(k-j0) and (t+k+j0)%2==0: res = 1 else: res = 0 else: if t%2==0: res = 0 else: dl = dr = None if i1!=INF and i0!=INF: dr = abs(i1-i0) if j0!=INF and j1!=INF: dl = abs(j0-j1) if (dl is not None and dl%2==0) and (dr is not None and dr%2==0): res = 0 else: res = 1 YES = "Alice" NO = "Bob" pans(res^(f^1))