QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#32153 | #1807. Distribute the Bars | Appleblue17 | WA | 3ms | 3664kb | C++ | 440b | 2022-05-17 20:49:54 | 2022-05-17 20:49:55 |
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");
}
}
}
puts("-1");
}
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 3664kb
input:
4
output:
2 2 1 7 2 3 5
result:
ok OK (2 groups)
Test #2:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
2
output:
-1
result:
ok OK (impossible)
Test #3:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
3
output:
-1
result:
ok OK (impossible)
Test #4:
score: -100
Wrong Answer
time: 2ms
memory: 3448kb
input:
1659
output:
-1
result:
wrong answer Jury found the solution, contestant isn't