QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#346861#5528. Least Annoying Constructive Problemucup-team134WA 0ms3912kbC++17395b2024-03-09 03:18:462024-03-09 03:18:48

Judging History

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

  • [2024-03-09 03:18:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3912kb
  • [2024-03-09 03:18:46]
  • 提交

answer

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

int m;
int add(int a,int b){
	a+=b;
	a%=m;
	if(a<0)a+=m;
	if(a==0)a=m;
	return a;
}
void Edge(int u,int v){
	if(u>v)swap(u,v);
	printf("%i %i\n",u,v);
}
int main(){
	int n;
	scanf("%i",&n);
	m=n%2==1?n:n-1;
	for(int i=1;i<=m;i++){
		for(int j=0;j<m/2;j++){
			Edge(add(i,-j),add(i,j+1));
		}
		Edge(i,n);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3912kb

input:

3

output:

1 2
1 3
2 3
2 3
1 3
3 3

result:

wrong output format Extra information in the output file