結果
| 問題 | 
                            No.2768 Password Crack
                             | 
                    
| コンテスト | |
| ユーザー | 
                             naut3
                         | 
                    
| 提出日時 | 2024-06-01 02:19:00 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 578 bytes | 
| コンパイル時間 | 483 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 28,272 KB | 
| 平均クエリ数 | 1045.03 | 
| 最終ジャッジ日時 | 2024-12-21 04:30:27 | 
| 合計ジャッジ時間 | 10,020 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 5 WA * 24 | 
ソースコード
import random
def main():
    alphas = [chr(ord('a') + i) for i in range(26)]
    ans = []
    N = int(input())
    for i in range(N):
        random.shuffle(alphas)
        T = ['a' for _ in range(N)]
        counts_max = None
        for x in alphas:
            T[i] = x
            print("? ", *T, sep="", flush=True)
            c = int(input())
            if counts_max is None:
                counts_max = c
            else:
                if counts_max < c:
                    ans.append(x)
                    break
    print("! ", *ans, sep='')
main()
            
            
            
        
            
naut3