QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#106870#5528. Least Annoying Constructive ProblemLiberty12619WA 1ms3780kbC++20654b2023-05-19 16:32:452023-05-19 16:32:49

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-19 16:32:49]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3780kb
  • [2023-05-19 16:32:45]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define x first
#define y second
using namespace std;
const int N = 30,M = 1<<24,mod = 998244353,INF=1e9;
typedef pair<int,int>PII;
int n;
int get(int x)
{
    if(x<1) x+=n;
    if(x>n) x-=n;
    return x;
}
void solve()
{
    cin>>n;
    int ok =0;
    if(~n&1)    ok=n--;
    int k = n/2;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=k;j++)
            printf("%lld %lld\n",get(i-j+1),get(i+j));
        if(ok)  printf("%lld %lld\n",get(i+k+1),ok);
    }
}
signed main()
{
    int T =1;
    //cin>>T;
    while(T--)
    {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3780kb

input:

3

output:

1 2
2 3
3 1

result:

wrong answer Integer 1 violates the range [4, 3]