結果
| 問題 |
No.2353 Guardian Dogs in Spring
|
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2023-06-16 22:43:47 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 656 bytes |
| コンパイル時間 | 1,117 ms |
| コンパイル使用メモリ | 114,744 KB |
| 最終ジャッジ日時 | 2025-02-14 06:49:45 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>
using namespace std;
using ll = long long;
int main(){
int N, x, y, a, b;
cin >> N;
vector<tuple<int, int, int>> xy(N);
for (int i=0; i<N; i++){
cin >> x >> y;
xy[i] = {x, y, i+1};
}
sort(xy.begin(), xy.end());
cout << N/2 << endl;
for (int i=0; i<N/2; i++){
tie(x, y, a) = xy[i*2];
tie(x, y, b) = xy[i*2+1];
cout << a << " " << b << endl;
}
return 0;
}
srjywrdnprkt