QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#32153#1807. Distribute the BarsAppleblue17WA 3ms3664kbC++440b2022-05-17 20:49:542022-05-17 20:49:55

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-17 20:49:55]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3664kb
  • [2022-05-17 20:49:54]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n;

int main(){
	cin>>n;
	if(n%2==0 && n>2){
		printf("%d\n",n/2);
		for(int i=1;i<=n/2;i++) printf("2 %d %d\n",2*i-1,2*(n+1-i)-1);
		return 0;
	}
	for(int i=2;i<n;i++){
		if(i*i==n){
			printf("%d\n",i);
			for(int j=0;j<i;j++){
				printf("%d ",i);
				for(int t=0;t<i;t++){
					printf("%d ",2*(t*i+(t+j)%i+1)-1);
				}
				printf("\n");
			}
		}
	}
	puts("-1");
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 3664kb

input:

4

output:

2
2 1 7
2 3 5

result:

ok OK (2 groups)

Test #2:

score: 0
Accepted
time: 3ms
memory: 3564kb

input:

2

output:

-1

result:

ok OK (impossible)

Test #3:

score: 0
Accepted
time: 3ms
memory: 3560kb

input:

3

output:

-1

result:

ok OK (impossible)

Test #4:

score: -100
Wrong Answer
time: 2ms
memory: 3448kb

input:

1659

output:

-1

result:

wrong answer Jury found the solution, contestant isn't