結果
| 問題 |
No.5016 Worst Mayor
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-04-29 16:31:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 2,000 ms |
| コード長 | 1,215 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 10,940 KB |
| 実行使用メモリ | 25,216 KB |
| スコア | 14,259,086,564 |
| 平均クエリ数 | 400.00 |
| 最終ジャッジ日時 | 2023-04-29 16:31:42 |
| 合計ジャッジ時間 | 8,805 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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<25:
print(2,flush=True)
elif days<45:
print(3,flush=True)
elif int(10**7/sqrt(v))<u and days<300 and bridge<26 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
elif v<100 and (23-bridge)*(int(10**7/sqrt(v))-int(10**7/sqrt(v+1)))>50000:
print(2,flush=True)
else:
print(3,flush=True)
titia