QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#32150 | #1807. Distribute the Bars | Appleblue17 | WA | 2ms | 3688kb | C++ | 384b | 2022-05-17 20:46:45 | 2022-05-17 20:46:45 |
Judging History
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