QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#32150#1807. Distribute the BarsAppleblue17WA 2ms3688kbC++384b2022-05-17 20:46:452022-05-17 20:46:45

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:46:45]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3688kb
  • [2022-05-17 20:46:45]
  • 提交

answer

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

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3688kb

input:

4

output:

2
1 4
2 3

result:

wrong answer Even numbers not allowed