QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#32152#1807. Distribute the BarsAppleblue17WA 3ms3748kbC++431b2022-05-17 20:49:032022-05-17 20:49:05

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:05]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3748kb
  • [2022-05-17 20:49:03]
  • 提交

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");
			}
			
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4

output:

2
2 1 7
2 3 5

result:

ok OK (2 groups)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3708kb

input:

2

output:


result:

wrong output format Unexpected end of file - int32 expected