結果
| 問題 | No.5016 Worst Mayor | 
| コンテスト | |
| ユーザー |  noriaoki | 
| 提出日時 | 2023-04-29 15:44:08 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 880 bytes | 
| コンパイル時間 | 980 ms | 
| コンパイル使用メモリ | 87,044 KB | 
| 実行使用メモリ | 113,556 KB | 
| スコア | 0 | 
| 最終ジャッジ日時 | 2023-04-29 15:44:16 | 
| 合計ジャッジ時間 | 7,651 ms | 
| ジャッジサーバーID (参考情報) | judge14 / judge15 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 1 -- * 49 | 
ソースコード
import math
import random
# N = 3000, T = 400
N, T = map(int, input().split())
ABCD = [map(int, input().split()) for _ in range(N)]
block  = [[0] * 14 for _ in range(14)]
bridge = set()
def build():
    direction = [(1,0), (-1,0), (0,1), (0,-1)]
    a = 4
    b = 9
    while True:
        x = random.randint(a, b)
        y = random.randint(a, b)
        for i, v in direction:
            z = x + i
            w = y + v
            score = x + y * (b - a + 1) + z * (b - a + 1) ** 2 + w * (b - a + 1) **3
            if a <= z <= b and a <= w <= b and not score in bridge:
                bridge.add(score)
                return x, y, z, w
            
for i in range(T):
    u, v = map(int, input().split())
    if i > 300:
        print(3)
    elif u * math.sqrt(v) < 10**7:
        print(2)
    else:
        x, y, z, w = build()
        print(1, x+1, y+1, z+1, w+1)
            
            
            
        