結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー minimumminimum
提出日時 2024-02-23 22:12:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 559 ms / 2,000 ms
コード長 791 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 102,532 KB
最終ジャッジ日時 2024-02-23 22:13:38
合計ジャッジ時間 40,708 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,588 KB
testcase_01 AC 416 ms
78,568 KB
testcase_02 AC 411 ms
77,804 KB
testcase_03 AC 435 ms
78,428 KB
testcase_04 AC 451 ms
87,684 KB
testcase_05 AC 493 ms
88,308 KB
testcase_06 AC 460 ms
88,436 KB
testcase_07 AC 537 ms
92,660 KB
testcase_08 AC 502 ms
92,788 KB
testcase_09 AC 501 ms
93,476 KB
testcase_10 AC 531 ms
93,172 KB
testcase_11 AC 505 ms
93,556 KB
testcase_12 AC 492 ms
94,112 KB
testcase_13 AC 550 ms
96,864 KB
testcase_14 AC 535 ms
100,988 KB
testcase_15 AC 537 ms
96,436 KB
testcase_16 AC 496 ms
93,816 KB
testcase_17 AC 513 ms
94,892 KB
testcase_18 AC 513 ms
95,920 KB
testcase_19 AC 507 ms
94,964 KB
testcase_20 AC 528 ms
101,156 KB
testcase_21 AC 518 ms
101,272 KB
testcase_22 AC 503 ms
101,268 KB
testcase_23 AC 500 ms
101,180 KB
testcase_24 AC 512 ms
101,188 KB
testcase_25 AC 506 ms
101,244 KB
testcase_26 AC 540 ms
101,156 KB
testcase_27 AC 521 ms
101,164 KB
testcase_28 AC 523 ms
101,276 KB
testcase_29 AC 559 ms
101,228 KB
testcase_30 AC 513 ms
101,124 KB
testcase_31 AC 496 ms
101,076 KB
testcase_32 AC 512 ms
101,204 KB
testcase_33 AC 508 ms
101,196 KB
testcase_34 AC 508 ms
101,268 KB
testcase_35 AC 494 ms
101,244 KB
testcase_36 AC 544 ms
101,092 KB
testcase_37 AC 499 ms
101,308 KB
testcase_38 AC 540 ms
102,532 KB
testcase_39 AC 508 ms
101,220 KB
testcase_40 AC 382 ms
94,124 KB
testcase_41 AC 304 ms
101,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt


def solve():
    N, L = map(int, input().split())
    C = max(1, (int(sqrt(2 * (L * L) // N))))
    ls = [[] for _ in range(L // C + 2)]

    for _ in range(N):
        x, y = map(int, input().split())
        ls[y // C].append((x, y))
    
    ans = []
    for i in range(L // C + 2):
        if len(ls[i]) == 0:
            continue
        ls[i].sort()
        for x, y in ls[i]:
            # print(x, y)
            ans.append((x, y))
    
    print(len(ans))
    for x, y in ans:
        print(x, y)

    # total = 0
    # for i in range(len(ans)):
    #     total += abs(ans[i][0] - ans[(i + 1) % len(ans)][0])
    #     total += abs(ans[i][1] - ans[(i + 1) % len(ans)][1])
    # print("deb", total < 1000 * L)


T = int(input())
for _ in range(T):
    solve()
0