結果
問題 |
No.5016 Worst Mayor
|
ユーザー |
![]() |
提出日時 | 2023-04-29 14:50:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,078 bytes |
コンパイル時間 | 133 ms |
コンパイル使用メモリ | 11,060 KB |
実行使用メモリ | 25,204 KB |
スコア | 0 |
平均クエリ数 | 168.24 |
最終ジャッジ日時 | 2023-04-29 14:50:13 |
合計ジャッジ時間 | 7,817 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 50 |
ソースコード
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<28 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)