QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#135660 | #5176. 多控制反转 | 1kri | 0 | 2ms | 5524kb | C++14 | 911b | 2023-08-05 20:36:05 | 2023-08-05 20:36:08 |
Judging History
answer
#include <iostream>
#include <cstdio>
using namespace std;
int n,m,q,sub_id;
int tot,sta[1000005][4];
int c[1000005];
void add(int a,int b,int c,int d){
++tot;
sta[tot][0]=a,sta[tot][1]=b,sta[tot][2]=c,sta[tot][3]=d;
return;
}
void work(int a,int b,int o){
if (a==0){
add(2,a,b,-1);
return;
}
if (a==1){
add(3,a-1,a,b);
return;
}
if (o==1)add(3,a,2*n+1-b,b);
work(a-1,2*n+1-b,1);
if (o==1)add(3,a,2*n+1-b,b);
return;
}
int main(){
cin>>n>>m>>q>>sub_id;
if (n==0){
cout<<1<<endl;
cout<<"1 0"<<endl;
return 0;
}
if (n==1){
cout<<1<<endl;
cout<<"2 0 1"<<endl;
return 0;
}
if (n==2){
cout<<1<<endl;
cout<<"3 0 1 2"<<endl;
return 0;
}
work(n-1,n,1);
work(n-1,n,0);
cout<<tot<<endl;
for (int i=1;i<=tot;i++){
cout<<sta[i][0]<<' ';
for (int j=1;j<=sta[i][0];j++)cout<<sta[i][j]<<' ';
cout<<endl;
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 15
Accepted
time: 1ms
memory: 3576kb
input:
0 2 1 1
output:
1 1 0
result:
ok OK.
Test #2:
score: -15
Wrong Answer
time: 2ms
memory: 5480kb
input:
13 28 105 1
output:
44 3 12 14 13 3 11 13 14 3 10 14 13 3 9 13 14 3 8 14 13 3 7 13 14 3 6 14 13 3 5 13 14 3 4 14 13 3 3 13 14 3 2 14 13 3 0 1 14 3 2 14 13 3 3 13 14 3 4 14 13 3 5 13 14 3 6 14 13 3 7 13 14 3 8 14 13 3 9 13 14 3 10 14 13 3 11 13 14 3 12 14 13 3 11 13 14 3 10 14 13 3 9 13 14 3 8 ...
result:
wrong answer Wrong solution.
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #13:
score: 10
Accepted
time: 1ms
memory: 3412kb
input:
0 2 1 4
output:
1 1 0
result:
ok OK.
Test #14:
score: -10
Wrong Answer
time: 2ms
memory: 5392kb
input:
18 20 325 4
output:
64 3 17 19 18 3 16 18 19 3 15 19 18 3 14 18 19 3 13 19 18 3 12 18 19 3 11 19 18 3 10 18 19 3 9 19 18 3 8 18 19 3 7 19 18 3 6 18 19 3 5 19 18 3 4 18 19 3 3 19 18 3 2 18 19 3 0 1 18 3 2 18 19 3 3 19 18 3 4 18 19 3 5 19 18 3 6 18 19 3 7 19 18 3 8 18 19 3 9 19 18 3 10 18 19 3 1...
result:
wrong answer Wrong solution.
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Wrong Answer
Test #20:
score: 0
Wrong Answer
time: 2ms
memory: 5524kb
input:
14 16 393 6
output:
48 3 13 15 14 3 12 14 15 3 11 15 14 3 10 14 15 3 9 15 14 3 8 14 15 3 7 15 14 3 6 14 15 3 5 15 14 3 4 14 15 3 3 15 14 3 2 14 15 3 0 1 14 3 2 14 15 3 3 15 14 3 4 14 15 3 5 15 14 3 6 14 15 3 7 15 14 3 8 14 15 3 9 15 14 3 10 14 15 3 11 15 14 3 12 14 15 3 13 15 14 3 12 14 15 3 1...
result:
wrong answer Wrong solution.
Subtask #7:
score: 0
Skipped
Dependency #2:
0%
Subtask #8:
score: 0
Skipped
Dependency #3:
0%