QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#401983#5528. Least Annoying Constructive Problemando#WA 0ms3628kbC++14709b2024-04-29 18:12:302024-04-29 18:12:31

Judging History

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

  • [2024-04-29 18:12:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2024-04-29 18:12:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
typedef long long ll;
typedef unsigned long long ull;
const int N = 2e6 + 10, MOD = 998244353;
const ll INF = 1e18;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n; cin >> n;
    int k = n / 2, tot = n;
    if (n % 2 == 0) k--, tot--;
    for (int i = 0; i < tot; i++) {
        for (int j = 1; j <= k; j++) {
            cout << (i - j + 1 + tot) % tot + 1 << ' ' << (i + j) % tot + 1 << '\n';
        }
        if (n % 2 == 0) cout << (i + (tot + 1) / 2) % tot + 1 << ' ' << n << '\n';
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3628kb

input:

3

output:

1 2
2 3
3 1

result:

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