QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#540274#8934. Challenge NPCucup-team3877#WA 0ms3616kbC++201.1kb2024-08-31 16:48:062024-08-31 16:48:10

Judging History

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

  • [2024-08-31 16:48:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-08-31 16:48:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb(a) push_back(a)
#define rep(i, n) for(int i=0;i<n;i++)
#define foa(e, v) for(auto& e : v)
using ll = long long;
const ll MOD7 = 1000000007, MOD998 = 998244353, INF = (1LL << 60);
#define dout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k;
    cin >> k;
    k += 2;
    int n = k * 2;
    vector<pair<int, int>> edges;

    for(int i = 1; i <= n; i ++) {
        if(i & 1) {
            for(int j = 2; j < i; j += 2) {
                edges.push_back({j, i});
            }
        } else {
            for(int j = 1; j + 2 < i; j += 2) {
                edges.push_back({j, i});
            }
        }
    }
    // for(int i = 1; i < n; i += 2) edges.push_back({i, n});
    cout << n << " " << edges.size() << " " << 2 << endl;
    for(int i = 1; i <= n ; i++) {
        cout << (i + 1) / 2 << " ";
    }
    cout << endl;
    for(auto [x, y] : edges) {
        cout << x << " " << y << endl;
    }
    return 0; 
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1

output:

6 6 2
1 1 2 2 3 3 
2 3
1 4
2 5
4 5
1 6
3 6

result:

wrong answer Integer parameter [name=col] equals to 3, violates the range [1, 2]