QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606822#8934. Challenge NPCUESTC_PenaltyAutomaton#WA 26ms9900kbC++141.4kb2024-10-03 12:30:392024-10-03 12:30:41

Judging History

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

  • [2024-10-03 12:30:41]
  • 评测
  • 测评结果:WA
  • 用时:26ms
  • 内存:9900kb
  • [2024-10-03 12:30:39]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include <valarray>
#include <cmath>
#include <numeric>
#include <random>

using namespace std;

#define ll long long

const int maxN = 2e5+10, mod = 998244353, inf = 1e9+10;
int k;

ll power(ll x, ll y, ll p){
    ll an = 1;
    while (y){
        if (y & 1) an = an*x % p;
        x = x*x % p;
        y >>= 1;
    }
    return an;
}

ll inv(ll x, ll p){
    return power(x, p-2, p);
}

vector<int> v1[maxN];

void solve() {
    cin >> k;
    k = 500;
    int n = 2*k+2, m = 0;
    vector<int> v;
    for (int i = 2; i <= n; i+=2) v.push_back(i);
    for (int i = n-1; i >= 1; i-=2) v.push_back(i);
    for (int i = 0; i < v.size()-1; ++i) {
        for (int j = 1; j+i <= v.size()-1; j+=2) {
            if (v[i] == 2 && v[j+i] == 1) continue;
            m++;
            v1[v[i]].push_back(v[j+i]);
        }
    }
    cout << n << " " << m << " " << 2 << "\n";
    vector<int> co(n+5, 0);
    int d = 1;
    for (auto i:v) {
        co[i] = d;
        if (d == 1) d = 2;
        else d = 1;
    }
    for (int i = 1; i <= n; i++) cout << co[i] << " \n"[i == n];
    for (int j = 1; j <= n; ++j) {
        for (auto i:v1[j]) {
            cout << i << " " << j << "\n";
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie();
    int t = 1;
    while (t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 20ms
memory: 9900kb

input:

1

output:

1002 251000 2
2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 ...

result:

ok ok

Test #2:

score: -100
Wrong Answer
time: 26ms
memory: 9680kb

input:

2

output:

1002 251000 2
2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 ...

result:

wrong answer The graph is not correct