結果
| 問題 |
No.2353 Guardian Dogs in Spring
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2023-06-28 19:40:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 615 bytes |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 57,776 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 13:05:16 |
| 合計ジャッジ時間 | 5,332 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2353.cc: No.2353 Guardian Dogs in Spring - yukicoder
*/
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 8000;
/* typedef */
typedef vector<int> vi;
/* global variables */
vi ps[MAX_N];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int x, y;
scanf("%d%d", &x, &y);
ps[i] = { x, y, i };
}
sort(ps, ps + n);
printf("%d\n", n / 2);
for (int i = 0; i + 1 < n; i += 2)
printf("%d %d\n", ps[i][2] + 1, ps[i + 1][2] + 1);
return 0;
}
tnakao0123