QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606781#8934. Challenge NPCUESTC_PenaltyAutomaton#WA 1ms8360kbC++141.4kb2024-10-03 12:07:292024-10-03 12:07:29

Judging History

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

  • [2024-10-03 12:07:29]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:8360kb
  • [2024-10-03 12:07:29]
  • 提交

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;
    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] << " ";
    cout << "\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;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 8268kb

input:

1

output:

4 3 2
2 1 1 2 
4 2
1 3
3 4

result:

ok ok

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 8360kb

input:

2

output:

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

result:

wrong answer The graph is not correct