結果
問題 | No.2353 Guardian Dogs in Spring |
ユーザー |
|
提出日時 | 2023-07-07 07:33:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 574 bytes |
コンパイル時間 | 3,381 ms |
コンパイル使用メモリ | 203,524 KB |
最終ジャッジ日時 | 2025-02-15 06:31:11 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 40 |
ソースコード
typedef long long ll;typedef long double ld;#include <bits/stdc++.h>using namespace std;#define int long longsigned main(){ll n;std::cin >> n;vector<tuple<ll,ll,ll>> xy(n);vector<ll> ans;for (int i = 0; i < n; i++) {ll x,y;std::cin >> x>>y;xy[i] = {x,y,i};}sort(xy.begin(),xy.end());std::cout << xy.size()/2 << std::endl;for (int i = 0; i < xy.size()/2; i++) {auto [t1,t2,t3] = xy[2*i];auto [t12,t22,t32] = xy[2*i+1];std::cout << t3+1<<" "<<t32+1 << std::endl;}}