QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84971#5528. Least Annoying Constructive ProblemIgnotusWA 2ms3496kbC++14407b2023-03-06 21:25:372023-03-06 21:25:46

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 21:25:46]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3496kb
  • [2023-03-06 21:25:37]
  • 提交

answer

#include <bits/stdc++.h>

int n;
bool ev;

void add(int x, int y){
	x = (x + n) % n, y = (y + n) % n;
	if(x > y) std::swap(x, y);
	std::cout << x + 1 << " " << y + 1 << '\n';
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	if(n % 2 == 0) ev = 1, --n;
	for(int i = 0; i < n; ++i){
		if(ev) add(i, n);
		for(int j = 1; j <= n / 2; ++j) add(i - j, i + j);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

2 3
1 3
1 2

result:

ok Correct

Test #2:

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

input:

4

output:

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

result:

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