QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#84968#5528. Least Annoying Constructive ProblemIgnotusWA 2ms3492kbC++14411b2023-03-06 21:24:512023-03-06 21:24:54

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:24:54]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3492kb
  • [2023-03-06 21:24:51]
  • 提交

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 - 1);
		for(int j = 1; j <= n / 2; ++j) add(i - j, i + j);
	}
	return 0;
}

详细

Test #1:

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

input:

3

output:

2 3
1 3
1 2

result:

ok Correct

Test #2:

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

input:

4

output:

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

result:

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