結果

問題 No.2353 Guardian Dogs in Spring
ユーザー 沙耶花沙耶花
提出日時 2023-06-16 21:49:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 647 bytes
コンパイル時間 4,448 ms
コンパイル使用メモリ 259,888 KB
実行使用メモリ 71,240 KB
最終ジャッジ日時 2023-09-06 19:21:09
合計ジャッジ時間 14,887 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
4,376 KB
testcase_01 AC 72 ms
4,380 KB
testcase_02 AC 71 ms
4,380 KB
testcase_03 AC 74 ms
4,376 KB
testcase_04 AC 72 ms
4,376 KB
testcase_05 AC 82 ms
4,384 KB
testcase_06 AC 149 ms
71,240 KB
testcase_07 AC 152 ms
69,424 KB
testcase_08 AC 150 ms
69,428 KB
testcase_09 AC 112 ms
57,248 KB
testcase_10 AC 145 ms
23,620 KB
testcase_11 AC 155 ms
35,496 KB
testcase_12 AC 160 ms
71,240 KB
testcase_13 AC 123 ms
64,448 KB
testcase_14 AC 77 ms
23,984 KB
testcase_15 AC 156 ms
67,792 KB
testcase_16 AC 154 ms
67,740 KB
testcase_17 AC 159 ms
67,656 KB
testcase_18 AC 154 ms
67,708 KB
testcase_19 AC 153 ms
67,740 KB
testcase_20 AC 119 ms
43,208 KB
testcase_21 AC 134 ms
9,288 KB
testcase_22 AC 142 ms
16,956 KB
testcase_23 AC 152 ms
30,020 KB
testcase_24 AC 137 ms
48,628 KB
testcase_25 AC 138 ms
7,724 KB
testcase_26 AC 139 ms
7,196 KB
testcase_27 AC 119 ms
4,996 KB
testcase_28 AC 137 ms
10,012 KB
testcase_29 AC 143 ms
22,796 KB
testcase_30 AC 149 ms
55,976 KB
testcase_31 AC 148 ms
20,804 KB
testcase_32 AC 152 ms
30,476 KB
testcase_33 AC 146 ms
60,720 KB
testcase_34 AC 150 ms
31,560 KB
testcase_35 AC 145 ms
59,092 KB
testcase_36 AC 89 ms
10,488 KB
testcase_37 AC 95 ms
7,616 KB
testcase_38 AC 99 ms
14,300 KB
testcase_39 AC 119 ms
14,332 KB
testcase_40 AC 118 ms
20,020 KB
testcase_41 AC 124 ms
21,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001

int ind[8005][8005];

int main(){
	int N;
	cin>>N;
	rep(i,N){
		int x,y;cin>>x>>y;
		ind[x][y] = i+1;
	}
	
	vector<int> a,b;
	rep(i,8005){
		rep(j,8005){
			if(ind[i][j]==0)continue;
			if(a.size()==b.size())a.push_back(ind[i][j]);
			else b.push_back(ind[i][j]);
		}
	}
	if(a.size()>b.size())a.pop_back();
	cout<<a.size()<<endl;
	rep(i,a.size()){
		cout<<a[i]<<' '<<b[i]<<endl;
	}
	
	return 0;
}
0