QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#135522#5176. 多控制反转1kri0 2ms5508kbC++14852b2023-08-05 17:00:312023-08-05 17:00:32

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 17:00:32]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:5508kb
  • [2023-08-05 17:00:31]
  • 提交

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){
	if (a==0){
		add(2,a,b,-1);
		return;
	}
	if (a==1){
		add(3,a-1,a,b);
		return;
	}
	add(3,a,b+1,b);
	work(a-1,b+1);
	add(3,a,b+1,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);
	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: 3460kb

input:

0 2 1 1

output:

1
1 0

result:

ok OK.

Test #2:

score: -15
Wrong Answer
time: 2ms
memory: 5452kb

input:

13 28 105 1

output:

23
3 12 14 13 
3 11 15 14 
3 10 16 15 
3 9 17 16 
3 8 18 17 
3 7 19 18 
3 6 20 19 
3 5 21 20 
3 4 22 21 
3 3 23 22 
3 2 24 23 
3 0 1 24 
3 2 24 23 
3 3 23 22 
3 4 22 21 
3 5 21 20 
3 6 20 19 
3 7 19 18 
3 8 18 17 
3 9 17 16 
3 10 16 15 
3 11 15 14 
3 12 14 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: 3480kb

input:

0 2 1 4

output:

1
1 0

result:

ok OK.

Test #14:

score: -10
Wrong Answer
time: 2ms
memory: 5508kb

input:

18 20 325 4

output:

33
3 17 19 18 
3 16 20 19 
3 15 21 20 
3 14 22 21 
3 13 23 22 
3 12 24 23 
3 11 25 24 
3 10 26 25 
3 9 27 26 
3 8 28 27 
3 7 29 28 
3 6 30 29 
3 5 31 30 
3 4 32 31 
3 3 33 32 
3 2 34 33 
3 0 1 34 
3 2 34 33 
3 3 33 32 
3 4 32 31 
3 5 31 30 
3 6 30 29 
3 7 29 28 
3 8 28 27 
3 9 27 26 
3 10 26 25 
3 1...

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: 5392kb

input:

14 16 393 6

output:

25
3 13 15 14 
3 12 16 15 
3 11 17 16 
3 10 18 17 
3 9 19 18 
3 8 20 19 
3 7 21 20 
3 6 22 21 
3 5 23 22 
3 4 24 23 
3 3 25 24 
3 2 26 25 
3 0 1 26 
3 2 26 25 
3 3 25 24 
3 4 24 23 
3 5 23 22 
3 6 22 21 
3 7 21 20 
3 8 20 19 
3 9 19 18 
3 10 18 17 
3 11 17 16 
3 12 16 15 
3 13 15 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%