結果

問題 No.2353 Guardian Dogs in Spring
ユーザー AngrySadEightAngrySadEight
提出日時 2023-04-11 14:38:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 903 bytes
コンパイル時間 1,078 ms
コンパイル使用メモリ 96,036 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 12:41:40
合計ジャッジ時間 7,310 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 13 ms
6,944 KB
testcase_08 AC 14 ms
6,944 KB
testcase_09 RE -
testcase_10 AC 13 ms
6,940 KB
testcase_11 AC 14 ms
6,944 KB
testcase_12 AC 14 ms
6,940 KB
testcase_13 AC 14 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 16 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 5 ms
6,940 KB
testcase_22 AC 7 ms
6,944 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 4 ms
6,944 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 5 ms
6,940 KB
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 13 ms
6,944 KB
testcase_34 AC 14 ms
6,940 KB
testcase_35 AC 14 ms
6,940 KB
testcase_36 AC 4 ms
6,940 KB
testcase_37 AC 3 ms
6,940 KB
testcase_38 AC 5 ms
6,940 KB
testcase_39 AC 6 ms
6,944 KB
testcase_40 AC 8 ms
6,944 KB
testcase_41 AC 9 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <cassert>
using namespace std;

int main(){
    int N;
    cin >> N;
    assert((1 <= N && N <= 8000));
    vector<int> x(N);
    vector<int> y(N);
    map<pair<int,int>, int> mp;
    for (int i = 0; i < N; i++){
        cin >> x[i] >> y[i];
        assert((1 <= x[i] && x[i] <= 8000));
        assert((1 <= y[i] && y[i] <= 8000));
        assert((mp[pair<int,int>(x[i], y[i])] == 0));
        mp[pair<int,int>(x[i], y[i])]++;
    }
    vector<pair<pair<int,int>, int>> p(N);
    for (int i = 0; i < N; i++){
        pair<int,int> p_stat = pair<int,int>(x[i], y[i]);
        p[i] = pair<pair<int,int>, int>(p_stat, i);
    }
    sort(p.begin(), p.end());

    cout << N / 2 << endl;
    for (int i = 0; i < N - 1; i += 2){
        cout << p[i].second + 1 << " " << p[i + 1].second + 1 << endl;
    }
}
0