結果
問題 |
No.5016 Worst Mayor
|
ユーザー |
![]() |
提出日時 | 2023-04-29 15:07:14 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 250 ms / 2,000 ms |
コード長 | 881 bytes |
コンパイル時間 | 1,257 ms |
コンパイル使用メモリ | 86,652 KB |
実行使用メモリ | 94,980 KB |
スコア | 7,134,918,324 |
平均クエリ数 | 400.00 |
最終ジャッジ日時 | 2023-04-29 15:07:31 |
合計ジャッジ時間 | 15,009 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
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 = 3 b = 10 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)