結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー titiatitia
提出日時 2024-02-28 03:09:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 459 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 124,000 KB
最終ジャッジ日時 2024-02-28 03:10:19
合計ジャッジ時間 41,101 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,716 KB
testcase_01 AC 390 ms
79,764 KB
testcase_02 AC 341 ms
80,020 KB
testcase_03 AC 338 ms
80,416 KB
testcase_04 AC 442 ms
104,356 KB
testcase_05 AC 412 ms
102,580 KB
testcase_06 AC 420 ms
107,116 KB
testcase_07 AC 459 ms
110,716 KB
testcase_08 AC 424 ms
110,608 KB
testcase_09 AC 419 ms
111,004 KB
testcase_10 AC 454 ms
110,900 KB
testcase_11 AC 424 ms
111,464 KB
testcase_12 AC 425 ms
110,688 KB
testcase_13 AC 435 ms
112,644 KB
testcase_14 AC 448 ms
122,280 KB
testcase_15 AC 430 ms
117,520 KB
testcase_16 AC 424 ms
110,328 KB
testcase_17 AC 451 ms
111,872 KB
testcase_18 AC 433 ms
114,324 KB
testcase_19 AC 433 ms
111,548 KB
testcase_20 AC 413 ms
116,432 KB
testcase_21 AC 448 ms
115,504 KB
testcase_22 AC 410 ms
116,432 KB
testcase_23 AC 408 ms
116,304 KB
testcase_24 AC 430 ms
116,432 KB
testcase_25 AC 410 ms
116,304 KB
testcase_26 AC 408 ms
116,304 KB
testcase_27 AC 446 ms
116,560 KB
testcase_28 AC 409 ms
116,432 KB
testcase_29 AC 412 ms
116,432 KB
testcase_30 AC 439 ms
116,304 KB
testcase_31 AC 404 ms
116,304 KB
testcase_32 AC 406 ms
116,304 KB
testcase_33 AC 430 ms
116,304 KB
testcase_34 AC 406 ms
116,304 KB
testcase_35 AC 404 ms
116,304 KB
testcase_36 AC 411 ms
116,304 KB
testcase_37 AC 438 ms
116,304 KB
testcase_38 AC 406 ms
116,304 KB
testcase_39 AC 404 ms
116,304 KB
testcase_40 AC 346 ms
124,000 KB
testcase_41 AC 349 ms
119,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from operator import itemgetter

T=int(input())
for tests in range(T):
    N,L=map(int,input().split())
    P=[list(map(int,input().split())) for i in range(N)]

    c=L/(N**(1/2))

    LIST=[[] for i in range(int(L/c+3))]

    for x,y in P:
        LIST[int(x/c)].append((x,y))

    ANS=[]

    for i in range(len(LIST)):
        LIST[i].sort(key=itemgetter(1))

        if i%2==1:
            LIST[i].reverse()

        for x,y in LIST[i]:
            ANS.append((x,y))

    print(len(ANS)+1)

    for x,y in ANS:
        print(x,y)

    print(*ANS[0])
0