QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#32152 | #1807. Distribute the Bars | Appleblue17 | WA | 3ms | 3748kb | C++ | 431b | 2022-05-17 20:49:03 | 2022-05-17 20:49:05 |
Judging History
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