結果
問題 |
No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
|
ユーザー |
![]() |
提出日時 | 2024-02-23 23:16:40 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 699 bytes |
コンパイル時間 | 2,954 ms |
コンパイル使用メモリ | 248,060 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-09-29 08:43:10 |
合計ジャッジ時間 | 22,657 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 38 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int N, L; int X[201010], Y[201010], ord[201010]; void solve(){ cin >> N >> L; for(int i = 0;i < N;i++)cin >> X[i] >> Y[i]; for(int i = 0;i < N;i++)ord[i] = i; int B = L / sqrt(N); B = max(1, B); sort(ord, ord + N, [&B](int a, int b){ if(X[a] / B == X[a] / B){ return Y[a] < Y[b]; } return X[a] / B < X[a] / B; }); cout << N << endl; for(int i = 0;i < N;i++){ cout << X[ord[i]] << " " << Y[ord[i]] << " \n"; } } int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--)solve(); return 0; }