QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#84974 | #5528. Least Annoying Constructive Problem | Ignotus | WA | 2ms | 3488kb | C++14 | 436b | 2023-03-06 21:26:32 | 2023-03-06 21:26:55 |
Judging History
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) std::cout << i << " " << n + 1 << '\n';
for(int j = 1; j <= n / 2; ++j) add(i - j, i + j);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3344kb
input:
3
output:
2 3 1 3 1 2
result:
ok Correct
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3488kb
input:
4
output:
0 4 2 3 1 4 1 3 2 4 1 2
result:
wrong answer Integer 0 violates the range [1, 4]