QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#769798#9446. Construction of Townwoodie_0064#TL 0ms0kbC++20693b2024-11-21 19:25:522024-11-21 19:25:53

Judging History

你现在查看的是最新测评结果

  • [2024-11-21 19:25:53]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-11-21 19:25:52]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
const int mod = 998244353;
typedef long long ll;

void work(){
	int n,m;cin >> n >> m;
	vector <pair <int,int>> ans;
	for(int i = 0;i < m;i++) {
		int x;cin >> x;
	}
	m -= (n - 1);
	for(int i = 1;i < n;i++) ans.push_back({0,i});
	for(int i = 1;i < n;i++) {
		for(int j = i + 1;j < n;j++) {			
			if(!m) break;
			m -= 1;
			ans.push_back({i,j});
		}
		if(!m) break;
	}
	for(auto &[x,y] : ans) cout << x+ 1 << ' ' << y + 1 << '\n';
}


int main(){
	freopen("test.txt", "r", stdin);
	ios::sync_with_stdio(false);
	cin.tie(0);
	int T = 1;
//	cin >> T;
	while(T--){
		work();
	}	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

3 2
4 5

output:


result: