QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#409320 | #8300. Game Design | lonlyness | AC ✓ | 1ms | 5916kb | C++23 | 1.5kb | 2024-05-11 21:49:40 | 2024-05-11 21:49:41 |
Judging History
answer
#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cmath>
using namespace std;
#define int long long
#define endl "\n"
const int N = 3e5+10;
int n,m,k;
typedef pair<int,int> PII;
int p[N];
int c[N];
void solve()
{
cin>>n;
string s;
if(n==1)
{
cout<<2<<endl;
cout<<1<<endl;
cout<<1<<' '<<1000<<endl;
return;
}
while(n)
{
s+=n%2+'0';
n/=2;
}
reverse(s.begin(),s.end());
int last= 1;
int len = s.size();
int now = 0;
int idx= (s.size()-1)*3+1;
int tem= idx;
p[idx]=idx-3;
p[idx-1]=idx-2;
p[idx-2]=idx-3;
c[idx]=1;
c[idx-1]=1;
c[idx-2]=1;
if(s[1]=='0')c[idx-3]=1e9;
else c[idx-3]=2;
last++;
idx-=3;
for(int i = 1;i < len-1;i ++)
{
p[idx-1]=idx-2;
p[idx-2]=idx-3;
p[idx]=idx-3;
c[idx-1]=1;
c[idx-2]=1;
if(s[i+1]=='0')c[idx-3]=1e9;
else c[idx-3]=last+1;
last++;
idx-=3;
}
// c[1]=c[idx];
cout<<tem<<endl;
for(int i= 2;i <= tem;i ++)cout<<p[i]<<' ';
cout<<endl;
for(int i = 1;i <= tem;i ++)cout<<c[i]<<' ';
cout<<endl;
}
signed main()
{
ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
int t=1;
// cin>>t;
while(t--)
{
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 5908kb
input:
2
output:
4 1 2 1 1000000000 1 1 1
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
1
output:
2 1 1 1000
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 5616kb
input:
3
output:
4 1 2 1 2 1 1 1
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 5556kb
input:
4
output:
7 1 2 1 4 5 4 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #5:
score: 0
Accepted
time: 1ms
memory: 5616kb
input:
5
output:
7 1 2 1 4 5 4 3 1 1 1000000000 1 1 1
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 5680kb
input:
6
output:
7 1 2 1 4 5 4 1000000000 1 1 2 1 1 1
result:
ok correct
Test #7:
score: 0
Accepted
time: 1ms
memory: 5564kb
input:
7
output:
7 1 2 1 4 5 4 3 1 1 2 1 1 1
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 5652kb
input:
8
output:
10 1 2 1 4 5 4 7 8 7 1000000000 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #9:
score: 0
Accepted
time: 1ms
memory: 5868kb
input:
9
output:
10 1 2 1 4 5 4 7 8 7 4 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 5912kb
input:
11
output:
10 1 2 1 4 5 4 7 8 7 4 1 1 3 1 1 1000000000 1 1 1
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 5916kb
input:
23
output:
13 1 2 1 4 5 4 7 8 7 10 11 10 5 1 1 4 1 1 3 1 1 1000000000 1 1 1
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 5848kb
input:
64
output:
19 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #13:
score: 0
Accepted
time: 1ms
memory: 5584kb
input:
87
output:
19 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 7 1 1 6 1 1 5 1 1 1000000000 1 1 3 1 1 1000000000 1 1 1
result:
ok correct
Test #14:
score: 0
Accepted
time: 1ms
memory: 5620kb
input:
103
output:
19 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 7 1 1 6 1 1 5 1 1 1000000000 1 1 1000000000 1 1 2 1 1 1
result:
ok correct
Test #15:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
128
output:
22 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #16:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
325
output:
25 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 9 1 1 1000000000 1 1 7 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 3 1 1 1000000000 1 1 1
result:
ok correct
Test #17:
score: 0
Accepted
time: 1ms
memory: 5636kb
input:
567
output:
28 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 10 1 1 9 1 1 8 1 1 1000000000 1 1 6 1 1 5 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #18:
score: 0
Accepted
time: 1ms
memory: 5652kb
input:
9999
output:
40 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 14 1 1 13 1 1 12 1 1 11 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 6 1 1 5 1 1 4 1 1 1000000000 1 1 1000000000 1 1 1
result:
ok correct
Test #19:
score: 0
Accepted
time: 1ms
memory: 5672kb
input:
93256
output:
49 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 1000000000 1 1 1000000000 1 1 1000000000 1 1 14 1 1 1000000000 1 1 1000000000 1 1 11 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 7 1 1 6 1 1 1000000000 1 1 ...
result:
ok correct
Test #20:
score: 0
Accepted
time: 1ms
memory: 5908kb
input:
3532462
output:
64 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 1000000000 1 1 21 1 1 20 1 1 19 1 1 1000000000 1 1 17 1 1 1000000000 1 1 15 1 1 1000000000 1 1 13 1 1 12 1 1 1000000...
result:
ok correct
Test #21:
score: 0
Accepted
time: 1ms
memory: 5608kb
input:
54389236
output:
76 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 1000000000 1 1 1000000000 1 1 24 1 1 1000000000 1 1 22 1 1 21 1 1 20 1 1 19 1 1 ...
result:
ok correct
Test #22:
score: 0
Accepted
time: 0ms
memory: 5680kb
input:
93453967
output:
79 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 27 1 1 26 1 1 25 1 1 24 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 ...
result:
ok correct
Test #23:
score: 0
Accepted
time: 1ms
memory: 5916kb
input:
1000000000
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 1000000000 1 1 1000000000 1 1 1000000000 1 1...
result:
ok correct
Test #24:
score: 0
Accepted
time: 1ms
memory: 5668kb
input:
999999999
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 30 1 1 29 1 1 28 1 1 27 1 1 26 1 1 25 1 1 24...
result:
ok correct
Test #25:
score: 0
Accepted
time: 1ms
memory: 5612kb
input:
888888888
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 1000000000 1 1 1000000000 1 1 1000000000 1 1...
result:
ok correct
Test #26:
score: 0
Accepted
time: 1ms
memory: 5908kb
input:
333333334
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 1000000000 1 1 28 1 1 27 1 1 1000000000 1 1 25 1 1 10...
result:
ok correct
Test #27:
score: 0
Accepted
time: 1ms
memory: 5676kb
input:
83495645
output:
79 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 27 1 1 1000000000 1 1 25 1 1 24 1 1 23 1 1 1000000000 1 1 21 1 1 20 1 1...
result:
ok correct
Test #28:
score: 0
Accepted
time: 1ms
memory: 5708kb
input:
894567865
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 30 1 1 1000000000 1 1 1000000000 1 1 27 1 1 ...
result:
ok correct
Test #29:
score: 0
Accepted
time: 1ms
memory: 5680kb
input:
88479456
output:
79 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 ...
result:
ok correct
Test #30:
score: 0
Accepted
time: 1ms
memory: 5652kb
input:
1000000
output:
58 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 1000000000 1 1 14 1 1 1000000000 1 1 1000000000 1 1 11 1 1 ...
result:
ok correct
Test #31:
score: 0
Accepted
time: 0ms
memory: 5676kb
input:
429085001
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 29 1 1 1000000000 1 1 1000000000 1 1 26 1 1 100000000...
result:
ok correct
Test #32:
score: 0
Accepted
time: 1ms
memory: 5560kb
input:
882138811
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 30 1 1 29 1 1 1000000000 1 1 27 1 1 26 1 1 2...
result:
ok correct
Test #33:
score: 0
Accepted
time: 1ms
memory: 5904kb
input:
513157691
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 29 1 1 28 1 1 1000000000 1 1 26 1 1 25 1 1 24 1 1 100...
result:
ok correct
Test #34:
score: 0
Accepted
time: 1ms
memory: 5616kb
input:
813900859
output:
88 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 30 1 1 29 1 1 1000000000 1 1 27 1 1 26 1 1 2...
result:
ok correct
Test #35:
score: 0
Accepted
time: 0ms
memory: 5916kb
input:
454848871
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 29 1 1 28 1 1 27 1 1 1000000000 1 1 1000000000 1 1 24...
result:
ok correct
Test #36:
score: 0
Accepted
time: 1ms
memory: 5844kb
input:
151401319
output:
82 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 28 1 1 27 1 1 26 1 1 1000000000 1 1 1000000000 1 1 23 1 1 22 1...
result:
ok correct
Test #37:
score: 0
Accepted
time: 1ms
memory: 5612kb
input:
280898521
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 29 1 1 1000000000 1 1 1000000000 1 1 26 1 1 25 1 1 10...
result:
ok correct
Test #38:
score: 0
Accepted
time: 1ms
memory: 5860kb
input:
412968047
output:
85 1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 29 1 1 28 1 1 27 1 1 26 1 1 1000000000 1 1 24 1 1 23 ...
result:
ok correct
Extra Test:
score: 0
Extra Test Passed