結果
| 問題 | 
                            No.304 鍵(1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             maspy
                         | 
                    
| 提出日時 | 2020-01-21 13:33:57 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,322 bytes | 
| コンパイル時間 | 211 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 28,488 KB | 
| 平均クエリ数 | 1478.00 | 
| 最終ジャッジ日時 | 2024-07-16 19:17:29 | 
| 合計ジャッジ時間 | 2,770 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 6 | 
ソースコード
import sys
from functools import wraps
readline = sys.stdin.readline
DEBUG = True
# DEBUG = False
class Interactive:
    def __init__(self):
        self.ques_cnt = 0
        self.create_data()
    
    def create_data(self):
        import random
        x = random.randint(0,999)
        pwd = '{:03}'.format(x)
        print('created pwd:', pwd)
        self.pwd = pwd
        
    def resp_ques(self, *args):
        self.ques_cnt += 1
        if args == (self.pwd,):
            return 'unlocked'
        else:
            return 'locked'
            
    def resp_ans(self, *args):
        print('question cnt:', self.ques_cnt)
        pass
            
if DEBUG:
    interactive = Interactive()
    
def question(*args, offset=None):
    if offset is None:
        print(*args, flush=True)
    else:
        print(offset, *args, flush=True)
    if DEBUG:
        resp = interactive.resp_ques(*args)
        print(resp)
        return resp
    else:
        return readline()
    
def answer(*args, offset=None):
    if offset is None:
        print(*args, flush=True)
    else:
        print(offset, *args, flush=True)
    if DEBUG:
        interactive.resp_ans(*args)
    else:
        exit()
for x in range(1000):
    ques = '{:03}'.format(x)
    resp = question(ques)
    if resp == 'unlocked':
        exit()
            
            
            
        
            
maspy