QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#140634#5529. Most Annoying Constructive ProblemPhantomThreshold#WA 1ms3584kbC++20632b2023-08-16 15:04:112023-08-16 15:04:14

Judging History

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

  • [2023-08-16 15:04:14]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3584kb
  • [2023-08-16 15:04:11]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int n;
vector<pair<int,int>> ans;

void add(int x,int y){
	ans.emplace_back(x+1,y+1);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin >> n;
	if (n%2==0){
		for (int st=0;st<=n-2;st++){
			add(st,n-1);
			int x=st;
			int y=st;
			do{
				x=(x+1)%(n-1);
				y=(y+(n-1)-1)%(n-1);
				add(x,y);
			}while ((x+1)%(n-1)!=y);
		}
	}
	else{
		for (int st=0;st<=n-1;st++){
			int x=st;
			int y=st;
			do{
				x=(x+1)%n;
				y=(y+n-1)%n;
				add(x,y);
			}while ((x+1)%n!=y);
		}
	}
	for (auto [x,y]:ans) cout << x << " " << y << endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

4
1 0
3 3
4 1
6 15

output:

1 4
2 3
2 4
3 1
3 4
1 2

result:

wrong answer Token parameter [name=yes/no] equals to "1", doesn't correspond to pattern "[yY][eE][sS]|[nN][oO]" (test case 1)