QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#606830 | #8934. Challenge NPC | UESTC_PenaltyAutomaton# | WA | 21ms | 9948kb | C++14 | 1.4kb | 2024-10-03 12:32:57 | 2024-10-03 12:32:59 |
Judging History
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 = 508;
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: 21ms
memory: 9704kb
input:
1
output:
1018 259080 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: 21ms
memory: 9948kb
input:
2
output:
1018 259080 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