QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#163440#5528. Least Annoying Constructive ProblemmaxrgbyWA 1ms3696kbC++14420b2023-09-04 05:40:592023-09-04 05:41:00

Judging History

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

  • [2023-09-04 05:41:00]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3696kb
  • [2023-09-04 05:40:59]
  • 提交

answer

// Source: https://usaco.guide/general/io

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

int main() {
	int n;
	cin >> n;
	if(n%2 == 0){
		n--;
	}
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n/2;j++){
			int a = (i-j+n)%n;
			int b = (i+j+1)%n;
			if(a > b){
				swap(a,b);
			}
			cout << a+1 << " " << b+1 << endl;
		}
		if(n%2==1){
			cout << (i+n/2+1)%n+1 << " " << n+1 << endl;
		}
	}
}

详细

Test #1:

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

input:

3

output:

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

result:

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