結果
| 問題 |
No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-24 01:19:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 813 bytes |
| コンパイル時間 | 543 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 851,260 KB |
| 最終ジャッジ日時 | 2024-09-29 09:39:50 |
| 合計ジャッジ時間 | 6,650 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 1 MLE * 1 -- * 40 |
ソースコード
import bisect
import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
N, L = map(int, input().split())
DIV = int(L/(N**0.5))
XY = [list(map(int, input().split())) for _ in range(N)]
Z = [[[] for _ in range(DIV+1)] for _ in range(DIV+1)]
D = [0 for _ in range(DIV+1)]
D[DIV] = L+1
for i in range(1, DIV):
D[i] = int(L/DIV*i)
for i in range(N):
x, y = XY[i]
xpos = bisect.bisect_left(D, x)
ypos = bisect.bisect_left(D, y)
Z[xpos][ypos].append(i)
ans = []
for i in range(DIV+1):
for j in range(DIV+1):
if i%2==0:
k = j
else:
k = DIV-j
for l in Z[i][k]:
ans.append(XY[l])
print(len(ans))
for a in ans:
print(*a)