結果
問題 | No.2768 Password Crack |
ユーザー | Butterflv |
提出日時 | 2024-05-31 22:08:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 240 ms / 2,000 ms |
コード長 | 2,100 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 95,780 KB |
平均クエリ数 | 962.33 |
最終ジャッジ日時 | 2024-12-20 23:40:04 |
合計ジャッジ時間 | 8,015 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
94,180 KB |
testcase_01 | AC | 107 ms
93,552 KB |
testcase_02 | AC | 210 ms
95,456 KB |
testcase_03 | AC | 233 ms
95,580 KB |
testcase_04 | AC | 212 ms
95,148 KB |
testcase_05 | AC | 118 ms
93,536 KB |
testcase_06 | AC | 234 ms
95,572 KB |
testcase_07 | AC | 214 ms
95,132 KB |
testcase_08 | AC | 123 ms
94,112 KB |
testcase_09 | AC | 232 ms
95,420 KB |
testcase_10 | AC | 240 ms
95,424 KB |
testcase_11 | AC | 238 ms
95,780 KB |
testcase_12 | AC | 213 ms
95,224 KB |
testcase_13 | AC | 212 ms
95,380 KB |
testcase_14 | AC | 220 ms
95,544 KB |
testcase_15 | AC | 215 ms
95,392 KB |
testcase_16 | AC | 211 ms
95,692 KB |
testcase_17 | AC | 214 ms
95,008 KB |
testcase_18 | AC | 224 ms
95,564 KB |
testcase_19 | AC | 170 ms
94,080 KB |
testcase_20 | AC | 160 ms
94,980 KB |
testcase_21 | AC | 222 ms
95,656 KB |
testcase_22 | AC | 189 ms
94,008 KB |
testcase_23 | AC | 121 ms
93,928 KB |
testcase_24 | AC | 141 ms
94,152 KB |
testcase_25 | AC | 206 ms
95,480 KB |
testcase_26 | AC | 152 ms
94,024 KB |
testcase_27 | AC | 189 ms
94,752 KB |
testcase_28 | AC | 126 ms
93,884 KB |
testcase_29 | AC | 133 ms
94,048 KB |
ソースコード
def main(): ALP = "abcdefghijklmnopqrstuvwxyz" alp = [] for i in range(len(ALP)): alp.append(ALP[i]) alp = tuple(alp) import random rand_num = 1000 rand_alp = [] for i in range(rand_num): rand_alp.append(tuple(random.sample(alp, 26))) N=int(input()) base = ["a" for i in range(N)] kaku = [None for i in range(N)] # from collections import defaultdict for i in range(N): order = random.choice(rand_alp) now_nums = dict() flag = False for cha_num in range(26): if flag: break cha = order[cha_num] T = base[:] T[i] = cha print("?", "".join(T)) n=int(input()) if now_nums.get(n)==None: now_nums[n]=[cha] else: now_nums[n].append(cha) if cha_num>=2 and len(now_nums)==2: for key in now_nums: if len(now_nums[key])==1: kaku[i] = now_nums[key][0] flag = True break print("!", "".join(kaku)) if __name__ == "__main__": main() # ALP = "abcdefghijklmnopqrstuvwxyz" # alp = [] # for i in range(len(ALP)): # alp.append(ALP[i]) # alp = tuple(alp) # import random # rand_num = 1000 # rand_alp = [] # for i in range(rand_num): # rand_alp.append(tuple(random.sample(alp, 26))) # N=6 # S="bareas" # def judge(_T): # res = 0 # for i in range(N): # if S[i]==_T[i]: res+=1 # return res # base = ["a" for i in range(N)] # kaku = [None for i in range(N)] # # from collections import defaultdict # for i in range(N): # order = random.choice(rand_alp) # now_nums = dict() # flag = False # for cha_num in range(26): # if flag: break # cha = order[cha_num] # T = base[:] # T[i] = cha # # print("?", "".join(T)) # # n=int(input()) # n = judge("".join(T)) # if now_nums.get(n)==None: # now_nums[n]=[cha] # else: # now_nums[n].append(cha) # if cha_num>=2 and len(now_nums)==2: # for key in now_nums: # if len(now_nums[key])==1: # kaku[i] = now_nums[key][0] # flag = True # break # print("!", "".join())