結果
問題 | No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ |
ユーザー | InTheBloom |
提出日時 | 2024-02-23 23:44:21 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,125 bytes |
コンパイル時間 | 1,517 ms |
コンパイル使用メモリ | 122,932 KB |
実行使用メモリ | 7,296 KB |
最終ジャッジ日時 | 2024-02-23 23:44:57 |
合計ジャッジ時間 | 30,894 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,676 KB |
testcase_01 | AC | 226 ms
6,676 KB |
testcase_02 | AC | 220 ms
6,676 KB |
testcase_03 | AC | 222 ms
6,676 KB |
testcase_04 | AC | 219 ms
6,676 KB |
testcase_05 | AC | 221 ms
6,676 KB |
testcase_06 | AC | 221 ms
6,676 KB |
testcase_07 | AC | 224 ms
6,676 KB |
testcase_08 | AC | 221 ms
6,676 KB |
testcase_09 | AC | 232 ms
6,676 KB |
testcase_10 | AC | 222 ms
6,676 KB |
testcase_11 | AC | 251 ms
6,676 KB |
testcase_12 | AC | 225 ms
6,676 KB |
testcase_13 | AC | 228 ms
6,676 KB |
testcase_14 | WA | - |
testcase_15 | AC | 223 ms
6,676 KB |
testcase_16 | AC | 226 ms
6,676 KB |
testcase_17 | AC | 230 ms
6,676 KB |
testcase_18 | AC | 226 ms
6,676 KB |
testcase_19 | AC | 230 ms
6,676 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 194 ms
7,296 KB |
testcase_41 | AC | 189 ms
7,296 KB |
ソースコード
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <tuple> using namespace std; void solve (int N, int L, vector<pair<int, int>>& points) { // 最適解は求められないはず -> Moの巡回順でやってみる int width = (int) (L / sqrt(N)); vector<tuple<int, int, int>> query(N); for (int i = 0; i < N; i++) { query[i] = make_tuple(points[i].first, points[i].second, points[i].first / width); } sort(query.begin(), query.end(), [](tuple<int, int, int>& x, tuple<int, int, int>& y) { if (get<2>(x) != get<2>(y)) return get<2>(x) < get<2>(y); return get<1>(x) < get<1>(y); }); cout << N << "\n"; for (auto& q : query) { cout << get<0>(q) << " " << get<1>(q) << "\n"; } } int main () { int T; cin >> T; for (int t = 0; t < T; t++) { int N, L; cin >> N >> L; vector<pair<int, int>> points(N); for (int i = 0; i < N; i++) { int X, Y; cin >> X >> Y; points[i] = make_pair(X, Y); } solve(N, L, points); } }