QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#606875 | #8934. Challenge NPC | UESTC_PenaltyAutomaton# | AC ✓ | 25ms | 9632kb | C++14 | 1.5kb | 2024-10-03 12:49:04 | 2024-10-03 12:49:04 |
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;
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 == 0 && v[j+i] == v[i]-1 && v[i] != n) 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;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 8280kb
input:
1
output:
4 3 2 2 1 1 2 4 2 1 3 3 4
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 8280kb
input:
2
output:
6 7 2 2 1 1 2 2 1 4 2 5 2 1 3 6 4 3 5 5 6 1 6
result:
ok ok
Test #3:
score: 0
Accepted
time: 2ms
memory: 8512kb
input:
3
output:
8 13 2 2 1 1 2 2 1 1 2 4 2 8 2 5 2 1 3 6 4 7 4 3 5 8 6 1 6 5 7 1 7 7 8 3 8
result:
ok ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 8512kb
input:
4
output:
10 21 2 2 1 1 2 2 1 1 2 2 1 4 2 8 2 9 2 5 2 1 3 6 4 10 4 7 4 3 5 8 6 9 6 1 6 5 7 1 7 10 8 3 8 7 9 3 9 9 10 5 10 1 10
result:
ok ok
Test #5:
score: 0
Accepted
time: 1ms
memory: 8468kb
input:
5
output:
12 31 2 2 1 1 2 2 1 1 2 2 1 1 2 4 2 8 2 12 2 9 2 5 2 1 3 6 4 10 4 11 4 7 4 3 5 8 6 12 6 9 6 1 6 5 7 1 7 10 8 11 8 3 8 7 9 3 9 12 10 5 10 1 10 9 11 5 11 1 11 11 12 7 12 3 12
result:
ok ok
Test #6:
score: 0
Accepted
time: 19ms
memory: 9352kb
input:
433
output:
868 187923 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 2...
result:
ok ok
Test #7:
score: 0
Accepted
time: 16ms
memory: 9632kb
input:
500
output:
1002 250501 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 #8:
score: 0
Accepted
time: 25ms
memory: 9616kb
input:
499
output:
1000 249501 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 #9:
score: 0
Accepted
time: 16ms
memory: 9388kb
input:
457
output:
916 209307 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 2...
result:
ok ok
Test #10:
score: 0
Accepted
time: 20ms
memory: 9616kb
input:
497
output:
996 247507 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 2...
result:
ok ok
Extra Test:
score: 0
Extra Test Passed