結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
コンテスト
ユーザー yupooh
提出日時 2024-02-23 23:08:42
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 479 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 287 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 129,664 KB
最終ジャッジ日時 2026-04-15 18:39:31
合計ジャッジ時間 23,791 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline
t=int(input())
for _ in range(t):
  n,l=map(int,input().split())
  M=10000
  bucket=[[] for i in range(M)]
  for i in range(n):
    x,y=map(int,input().split())
    bucket[x*M//(10**9+1)].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