QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#84397 | #5528. Least Annoying Constructive Problem | shr_ | WA | 2ms | 3500kb | C++17 | 542b | 2023-03-06 14:33:46 | 2023-03-06 14:34:20 |
Judging History
answer
# include <bits/stdc++.h>
using namespace std;
int n;
int turn_(int x) { return (x-1)%n+1;}
int main() {
// freopen("in.in","r",stdin);
// freopen("out.out","w",stdout);
scanf("%d",&n);
int m=n;
if (n%2==0) n--;
vector<pair<int,int> > ans;
for (int i=1;i<=n;i++) {
if (n!=m) ans.push_back(pair<int,int> (i,n+1));
for (int j=1;j<=n/2;j++) ans.push_back(pair<int,int> (turn_(i+j),turn_(i+n-j)));
}
for (auto o : ans) printf("%d %d\n",o.first,o.second);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3500kb
input:
3
output:
2 3 3 1 1 2
result:
wrong answer Integer 1 violates the range [4, 3]