結果

問題 No.5016 Worst Mayor
ユーザー titiatitia
提出日時 2023-04-29 14:44:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 1,078 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 24,916 KB
スコア 11,462,958,180
平均クエリ数 400.00
最終ジャッジ日時 2023-04-29 14:44:41
合計ジャッジ時間 8,614 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
24,872 KB
testcase_01 AC 98 ms
24,400 KB
testcase_02 AC 97 ms
24,408 KB
testcase_03 AC 98 ms
24,608 KB
testcase_04 AC 96 ms
24,648 KB
testcase_05 AC 96 ms
24,444 KB
testcase_06 AC 96 ms
24,812 KB
testcase_07 AC 103 ms
24,536 KB
testcase_08 AC 99 ms
24,676 KB
testcase_09 AC 97 ms
24,640 KB
testcase_10 AC 112 ms
24,668 KB
testcase_11 AC 99 ms
24,804 KB
testcase_12 AC 97 ms
24,788 KB
testcase_13 AC 100 ms
24,820 KB
testcase_14 AC 100 ms
24,656 KB
testcase_15 AC 99 ms
24,632 KB
testcase_16 AC 98 ms
24,400 KB
testcase_17 AC 99 ms
24,496 KB
testcase_18 AC 98 ms
24,620 KB
testcase_19 AC 109 ms
24,268 KB
testcase_20 AC 100 ms
24,764 KB
testcase_21 AC 103 ms
24,296 KB
testcase_22 AC 102 ms
24,408 KB
testcase_23 AC 103 ms
24,700 KB
testcase_24 AC 104 ms
24,708 KB
testcase_25 AC 98 ms
24,264 KB
testcase_26 AC 99 ms
24,508 KB
testcase_27 AC 96 ms
24,160 KB
testcase_28 AC 109 ms
24,688 KB
testcase_29 AC 101 ms
24,820 KB
testcase_30 AC 102 ms
24,392 KB
testcase_31 AC 100 ms
24,272 KB
testcase_32 AC 95 ms
24,916 KB
testcase_33 AC 104 ms
24,168 KB
testcase_34 AC 102 ms
24,536 KB
testcase_35 AC 103 ms
24,500 KB
testcase_36 AC 100 ms
24,160 KB
testcase_37 AC 108 ms
24,352 KB
testcase_38 AC 100 ms
24,372 KB
testcase_39 AC 97 ms
24,816 KB
testcase_40 AC 102 ms
24,872 KB
testcase_41 AC 106 ms
24,652 KB
testcase_42 AC 101 ms
24,428 KB
testcase_43 AC 101 ms
24,244 KB
testcase_44 AC 98 ms
24,404 KB
testcase_45 AC 102 ms
24,292 KB
testcase_46 AC 106 ms
24,356 KB
testcase_47 AC 101 ms
24,156 KB
testcase_48 AC 102 ms
24,256 KB
testcase_49 AC 101 ms
24,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from operator import itemgetter
from math import sqrt

N,T=map(int,input().split())
P=[list(map(int,input().split())) for i in range(N)]

YOKO=[0]*16
TATE=[0]*16

for a,b,c,d in P:
    TATE[min(a,c)]+=1
    TATE[max(a,c)]-=1

    YOKO[min(b,d)]+=1
    YOKO[max(b,d)]-=1

for i in range(16):
    YOKO[i]+=YOKO[i-1]
    TATE[i]+=TATE[i-1]

YOKOI=[(YOKO[i],i) for i in range(16)]
TATEI=[(TATE[i],i) for i in range(16)]

YOKOI.sort(key=itemgetter(0))
TATEI.sort(key=itemgetter(0))

ymax=YOKOI[-1][1]
tmax=TATEI[-1][1]
bridge=0

for days in range(T):
    u,v=map(int,input().split())

    if days<100:
        print(2,flush=True)
        continue

    if int(10**7/sqrt(v))<u and days<300 and bridge<20 and YOKOI and TATEI:
        if YOKOI[-1][0]>TATEI[-1][0]:
            print(1,tmax,YOKOI[-1][1],tmax,YOKOI[-1][1]+1,flush=True)
            YOKOI.pop()
        else:
            print(1,TATEI[-1][1],ymax,TATEI[-1][1]+1,ymax,flush=True)
            TATEI.pop()
        bridge+=1
    else:
        print(3,flush=True)
        
        

    
0