QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#24261 | #1807. Distribute the Bars | Wu_Ren | WA | 3ms | 3676kb | C++17 | 497b | 2022-03-28 21:34:23 | 2022-04-30 05:22:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n,d,m;
int main(){
ios::sync_with_stdio(0);
cin>>n;
for(d=2;n%d;d++);
if(d==n) cout<<"-1\n",exit(0);
m=n/d;
if(d==2){
cout<<m<<"\n";
for(int i=0;i<m;i++) cout<<2*i+1<<" "<<2*n-2*i-1<<"\n";
}
else{
cout<<d<<"\n";
int c=0;
for(int i=0;i<d;i++){
cout<<m<<" ";
for(int j=0;j<d;j++) cout<<2*((i+j)%d+d*j)+1<<" ";
for(int j=d;j<m;j++) cout<<2*n-2*c-1<<" "<<2*d*d+1+2*c<<" ",c++;
cout<<"\n";
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3676kb
input:
4
output:
2 1 7 3 5
result:
wrong output format Unexpected end of file - int32 expected