結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー yupoohyupooh
提出日時 2024-02-23 23:13:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 836 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 108,216 KB
最終ジャッジ日時 2024-02-23 23:14:42
合計ジャッジ時間 50,102 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,716 KB
testcase_01 AC 505 ms
79,100 KB
testcase_02 AC 451 ms
78,852 KB
testcase_03 AC 499 ms
79,484 KB
testcase_04 AC 605 ms
91,548 KB
testcase_05 AC 609 ms
91,660 KB
testcase_06 AC 635 ms
92,428 KB
testcase_07 AC 728 ms
94,112 KB
testcase_08 AC 706 ms
94,204 KB
testcase_09 AC 721 ms
95,596 KB
testcase_10 AC 733 ms
95,116 KB
testcase_11 AC 754 ms
95,100 KB
testcase_12 AC 731 ms
95,004 KB
testcase_13 AC 793 ms
98,908 KB
testcase_14 AC 782 ms
107,752 KB
testcase_15 AC 759 ms
100,928 KB
testcase_16 AC 725 ms
94,292 KB
testcase_17 AC 763 ms
99,276 KB
testcase_18 AC 797 ms
97,860 KB
testcase_19 AC 766 ms
97,336 KB
testcase_20 AC 820 ms
107,960 KB
testcase_21 AC 765 ms
107,704 KB
testcase_22 AC 780 ms
108,088 KB
testcase_23 AC 760 ms
108,088 KB
testcase_24 AC 806 ms
107,704 KB
testcase_25 AC 778 ms
107,704 KB
testcase_26 AC 769 ms
108,088 KB
testcase_27 AC 805 ms
107,716 KB
testcase_28 AC 775 ms
108,088 KB
testcase_29 AC 789 ms
107,960 KB
testcase_30 AC 796 ms
108,088 KB
testcase_31 AC 775 ms
107,704 KB
testcase_32 AC 815 ms
108,216 KB
testcase_33 AC 788 ms
108,088 KB
testcase_34 AC 836 ms
108,216 KB
testcase_35 AC 780 ms
107,704 KB
testcase_36 AC 785 ms
107,828 KB
testcase_37 AC 774 ms
107,704 KB
testcase_38 AC 809 ms
108,088 KB
testcase_39 AC 805 ms
107,704 KB
testcase_40 AC 372 ms
106,432 KB
testcase_41 AC 287 ms
105,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
t=int(input())
for _ in range(t):
  n,l=map(int,input().split())
  M=int(n**0.5)+1
  bucket=[[] for i in range(M)]
  xy=[]
  X=[]
  for i in range(n):
    x,y=map(int,input().split())
    xy.append((x,y))
  xy.sort()
  for i in range(n):
    x,y=xy[i]
    bucket[i*M//n].append((x,y)) 
  for i in range(M):
    if i&1:
      bucket[i].sort(key=lambda x:-x[1])
    else:
      bucket[i].sort(key=lambda x:x[1])
  ans=[]
  for i in range(M):
    for j in bucket[i]:
      ans.append(j)
  print(n)
  for i in ans:
    print(*i)
0