結果
問題 | No.2353 Guardian Dogs in Spring |
ユーザー |
![]() |
提出日時 | 2023-07-20 12:36:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 2,106 ms |
コンパイル使用メモリ | 202,892 KB |
最終ジャッジ日時 | 2025-02-15 15:52:59 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 40 |
ソースコード
#include <bits/stdc++.h>using namespace std;using dog = tuple<int, int, int>;int main() {int n;cin >> n;vector<dog> dogs;for(int i = 1, x, y; i <= n; i ++) {cin >> x >> y;dogs.push_back({x, y, i});}sort(dogs.begin(), dogs.end());cout << n / 2 << "\n";for(int i = 1; i < n; i += 2) {cout << get<2>(dogs[i - 1]) << " " << get<2>(dogs[i]) << "\n";}}