結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー ococonomy1ococonomy1
提出日時 2024-02-23 22:05:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,341 bytes
コンパイル時間 1,106 ms
コンパイル使用メモリ 114,748 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-23 22:06:07
合計ジャッジ時間 22,488 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 89 ms
6,676 KB
testcase_02 AC 88 ms
6,676 KB
testcase_03 AC 90 ms
6,676 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
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 89 ms
6,676 KB
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
#define TEST cerr << "TEST" << endl
#define AMARI 998244353
//#define AMARI 1000000007
#define el '\n'
#define El '\n'

template <typename T> vector<T> getvec(int n,T val){
    vector<T> ans(n);
    for(int i = 0; i < n; i++){
        cin >> ans[i];
        ans[i] += val;
    }
    return ans;
}

template <typename T> void printvec(vector<T> const& a,T val){
    int n = a.size();
    for(int i = 0; i < n; i++){
        cout << (a[i] + val);
        if(i != n - 1)cout << ' ';
    }
    cout << '\n';
}

const int sq = 500;

bool hikaku(pii const& l,pii const& r){
    if(l.first / sq == r.first / sq)return l.second > r.second;
    else return l.first / sq < r.first / sq;
}

#define MULTI_TEST_CASE true
void solve(void){
    //問題を見たらまず「この問題設定から言えること」をいっぱい言う
    //一個回答に繋がりそうな解法が見えても、実装や細かい詰めに時間がかかりそうなら別の方針を考えてみる
    //添え字回りで面倒になりそうなときは楽になる言い換えを実装の前にじっくり考える
    //ある程度考察しても全然取っ掛かりが見えないときは実験をしてみる
    //よりシンプルな問題に言い換えられたら、言い換えた先の問題を自然言語ではっきりと書く
    int n;
    ll l;
    cin >> n >> l;
    vector<pii> x(n);
    for(int i = 0; i < n; i++){
        cin >> x[i].first >> x[i].second;
    }
    sort(x.begin(),x.end(),hikaku);
    cout << n << el;
    for(int i = 0; i < n; i++){
        cout << x[i].first << ' ' << x[i].second << el;
    }
    return;
}

void calc(void){
    return;
}

signed main(void){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    calc();
    int t = 1;
    if(MULTI_TEST_CASE)cin >> t;
    while(t--){
        solve();
    }
    return 0;
}
0