QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84426#5528. Least Annoying Constructive ProblemCharlieVinnieWA 0ms3312kbC++14578b2023-03-06 14:53:262023-03-06 14:53:29

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 14:53:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3312kb
  • [2023-03-06 14:53:26]
  • 提交

answer

#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rev(i,a,b) for(int i=a;i>=b;i--)
#define Fin(file) freopen(file,"r",stdin)
#define Fout(file) freopen(file,"w",stdout)
using namespace std; using ll = long long;
const int N=505;
int n;
void Solve1(){
	For(i,0,n-1){
		For(j,1,n/2) cout<<1+(i-j+n)%n<<' '<<1+(i+j)%n<<'\n';
	}
}
void Solve2(){
	For(i,0,n-2){
		For(j,1,n/2-1) cout<<1+(i-j+n-1)%(n-1)<<' '<<1+(i+j)%(n-1)<<'\n';
		cout<<1+i<<' '<<1+n-1<<'\n';
	}
}
int main(){
	cin>>n; if(n%2==1) Solve1(); else Solve2();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

3 2
1 3
2 1

result:

wrong answer Integer 2 violates the range [4, 3]