QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#84667 | #5528. Least Annoying Constructive Problem | KaiserWilheim | WA | 2ms | 3552kb | C++14 | 613b | 2023-03-06 16:42:40 | 2023-03-06 16:42:43 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
scanf("%d", &n);
if(n & 1)
{
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n / 2; j++)
{
int u = (i - j + n) % n + 1,
v = (i + j + 1) % n + 1;
printf("%d %d\n", u, v);
}
}
}
else
{
for(int i = 0; i < n - 1; i++)
{
for(int j = 0; j < n / 2 - 1; j++)
{
int u = (i - j + (n - 1)) % (n - 1) + 1,
v = (i + j + 1) % (n - 1) + 1;
printf("%d %d\n", u, v);
}
printf("%d %d\n", (i + n / 2) % (n - 1) + 1, n);
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3552kb
input:
3
output:
1 2 2 3 3 1
result:
wrong answer Integer 1 violates the range [4, 3]