QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#163440 | #5528. Least Annoying Constructive Problem | maxrgby | WA | 1ms | 3696kb | C++14 | 420b | 2023-09-04 05:40:59 | 2023-09-04 05:41:00 |
Judging History
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;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
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]