QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84295#5528. Least Annoying Constructive ProblemtrsinsWA 2ms3668kbC++14326b2023-03-06 09:33:142023-03-06 09:33:16

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-06 09:33:16]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3668kb
  • [2023-03-06 09:33:14]
  • 提交

answer

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

int n;
int main(){
	scanf("%d",&n);
	if(n%2==0)n--;
	for(int i=0;i<n;i++){
		for (int j=0;j<n/2;j++){
			int u=(i-j+n)%n+1,v=(i+j+1)%n+1;
			if(u>v)swap(u,v);
			printf("%d %d\n",u,v);
			if(n%2==0&&j==n/2-1)printf("%d %d\n",(i+n/2+1)%n+1,n+1);
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3524kb

input:

3

output:

1 2
2 3
1 3

result:

ok Correct

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3668kb

input:

4

output:

1 2
2 3
1 3

result:

wrong output format Unexpected end of file - int32 expected