結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー titia
提出日時 2024-02-28 03:06:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 134,812 KB
最終ジャッジ日時 2024-09-29 12:16:22
合計ジャッジ時間 37,436 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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**(1/2)

    LIST=[[] for i in range(int(L**(1/2)+3))]

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

    ANS=[]

    for i in range(len(LIST)):
        LIST[i].sort()

        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