QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#135495 | #5176. 多控制反转 | 1kri | 0 | 2ms | 5572kb | C++14 | 826b | 2023-08-05 16:25:36 | 2023-08-05 16:25:37 |
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;
}
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;
}
add(3,0,1,n+1);
c[n+1]^=1;
int o=n+1;
for (int i=2;i<n-1;i++){
add(3,i,o,2*n+3-o);
o=2*n+3-o;
c[o]^=1;
if (c[o]==0)add(1,o,-1,-1);
}
add(3,o,n-1,n);
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: 0ms
memory: 3520kb
input:
0 2 1 1
output:
1 1 0
result:
ok OK.
Test #2:
score: -15
Wrong Answer
time: 2ms
memory: 5572kb
input:
13 28 105 1
output:
17 3 0 1 14 3 2 14 15 3 3 15 14 1 14 3 4 14 15 1 15 3 5 15 14 3 6 14 15 3 7 15 14 1 14 3 8 14 15 1 15 3 9 15 14 3 10 14 15 3 11 15 14 1 14 3 14 12 13
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: 3456kb
input:
0 2 1 4
output:
1 1 0
result:
ok OK.
Test #14:
score: -10
Wrong Answer
time: 2ms
memory: 5456kb
input:
18 20 325 4
output:
25 3 0 1 19 3 2 19 20 3 3 20 19 1 19 3 4 19 20 1 20 3 5 20 19 3 6 19 20 3 7 20 19 1 19 3 8 19 20 1 20 3 9 20 19 3 10 19 20 3 11 20 19 1 19 3 12 19 20 1 20 3 13 20 19 3 14 19 20 3 15 20 19 1 19 3 16 19 20 1 20 3 20 17 18
result:
wrong answer Integer 20 violates the range [0, 19]
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Wrong Answer
Test #20:
score: 0
Wrong Answer
time: 2ms
memory: 5500kb
input:
14 16 393 6
output:
19 3 0 1 15 3 2 15 16 3 3 16 15 1 15 3 4 15 16 1 16 3 5 16 15 3 6 15 16 3 7 16 15 1 15 3 8 15 16 1 16 3 9 16 15 3 10 15 16 3 11 16 15 1 15 3 12 15 16 1 16 3 16 13 14
result:
wrong answer Integer 16 violates the range [0, 15]
Subtask #7:
score: 0
Skipped
Dependency #2:
0%
Subtask #8:
score: 0
Skipped
Dependency #3:
0%