結果
| 問題 |
No.2353 Guardian Dogs in Spring
|
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-06-16 21:48:03 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 625 bytes |
| コンパイル時間 | 2,053 ms |
| コンパイル使用メモリ | 204,784 KB |
| 最終ジャッジ日時 | 2025-02-14 05:09:31 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=2000000000000000000;
ll mod=998244353;
int main(){
ll n;
cin >> n;
vector<tuple<ll,ll,ll>>t(n);
for (ll i = 0; i < n; i++)
{
ll a,b;
cin >> a >> b;
t[i]={a,b,i};
}
sort(t.begin(),t.end());
vector<ll>ans(n);
for (ll i = 0; i < n; i++)
{
ans[i]=get<2>(t[i]);
}
cout << n/2 << endl;
for (ll i = 0; i < n-n%2; i++)
{
cout << ans[i]+1 << ' ';
if (i%2)
{
cout << endl;
}
}
}
hiro71687k