QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#84968 | #5528. Least Annoying Constructive Problem | Ignotus | WA | 2ms | 3492kb | C++14 | 411b | 2023-03-06 21:24:51 | 2023-03-06 21:24:54 |
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) add(i, n - 1);
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: 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]