結果

問題 No.5004 Room Assignment
ユーザー negibose2020
提出日時 2021-12-02 13:31:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 5,000 ms
コード長 988 bytes
コンパイル時間 243 ms
実行使用メモリ 97,456 KB
スコア 4,197
平均クエリ数 3601.00
最終ジャッジ日時 2021-12-02 13:31:52
合計ジャッジ時間 36,190 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

T,R=map(int,input().split())
t=0
N=5400
p=[-1]*(N+1)
tick=[-1]*(N+1)


s=set()
# スキル値, プレイヤーi, 出現チック
s.add((-10000000,-1,-1))
s.add((100000000,-1,-1))
pi=1
t_ans=set()

fist=True
_pl=set()
used=set()

import bisect
while t<3600 :
    L=list(map(int,input().split()))
    # if nowtime - stime >4.85:
    #     t+=1
    #     print(0)
    #     sys.stdout.flush()
    #     continue

    if fist == True and L[0]>3:
        # t+=1
        # print(0)
        # continue
        for i in range(L[0]-1):
            _pl.add(pi)
            pi+=1
        print(1)
        used.add(_pl.pop())
        used.add(_pl.pop())
        fist=False
        t+=1
        print(*list(used)[:2])
        continue

    # elif fist == False and len(_pl)>0:
    #     print(1)
    #     p=used.pop()
    #     pp=_pl.pop()
    #     used.add(p)
    #     used.add(pp)
    #     t+=1
    #     print(p,pp)
    #     continue

    else:
        t+=1
        print(0)
        continue
0