QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#714799 | #4902. 聚会 | Idtwtei | 0 | 0ms | 3984kb | C++14 | 1.4kb | 2024-11-06 07:56:03 | 2024-11-06 07:56:09 |
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e3+100;
#define gc getchar()
#define rd read()
inline int read(){
int x=0,f=0; char c=gc;
for(;c<'0'||c>'9';c=gc) f|=(c=='-');
for(;c>='0'&&c<='9';c=gc) x=(x<<1)+(x<<3)+(c^48);
return f?-x:x;
}
int n,a[N][N];
void sol3(int n){
int m=2*n+1;
for(int i=1;i<=m;++i) for(int x=i,y=i;!a[x][y];x=x%m+1,y=y%m+1) a[x][y]=i;
for(int i=1;i<=m;++i) printf("%d %d %d\n", i+0*m, i+1*m, i+2*m);
for(int i=1;i<=m;++i){
for(int j=i+1;j<=m;++j){
printf("%d %d %d\n", i+0*m, j+0*m, a[i][j]+1*m);
printf("%d %d %d\n", i+1*m, j+1*m, a[i][j]+2*m);
printf("%d %d %d\n", i+2*m, j+2*m, a[i][j]+0*m);
}
}
}
void sol1(int n){
int m=2*n;
for(int i=1;i<=n;++i) for(int x=i,y=i;!a[x][y];x=x%m+1,y=y%m+1) a[x][y]=i;
for(int i=1;i<=n;++i) for(int x=i,y=i+1;!a[x][y];x=x%m+1,y=y%m+1) a[x][y]=i+n;
for(int i=1;i<=n;++i) printf("%d %d %d\n", i+0*m, i+1*m, i+2*m);
for(int i=1;i<=n;++i){
printf("%d %d %d\n", 6*n+1, i+0*m, i+n+2*m);
printf("%d %d %d\n", 6*n+1, i+1*m, i+n+0*m);
printf("%d %d %d\n", 6*n+1, i+2*m, i+n+1*m);
}
for(int i=1;i<=m;++i){
for(int j=i+1;j<=m;++j){
printf("%d %d %d\n", i+0*m, j+0*m, a[i][j]+1*m);
printf("%d %d %d\n", i+1*m, j+1*m, a[i][j]+2*m);
printf("%d %d %d\n", i+2*m, j+2*m, a[i][j]+0*m);
}
}
}
int main(){
n=rd;
if(n%6==3) sol3(n/6);
else sol1(n/6);
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 9.09091
Accepted
time: 0ms
memory: 3636kb
input:
1
output:
result:
ok accepted
Test #2:
score: 9.09091
Accepted
time: 0ms
memory: 3856kb
input:
3
output:
1 2 3
result:
ok accepted
Test #3:
score: 9.09091
Accepted
time: 0ms
memory: 3784kb
input:
7
output:
1 3 5 7 1 6 7 3 2 7 5 4 1 2 4 3 4 6 5 6 2
result:
ok accepted
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 3984kb
input:
15
output:
1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 1 2 5 6 7 10 11 12 0 1 3 5 6 8 10 11 13 0 1 4 5 6 9 10 11 14 0 1 5 5 6 10 10 11 15 0 2 3 5 7 8 10 12 13 0 2 4 5 7 9 10 12 14 0 2 5 5 7 10 10 12 15 0 3 4 5 8 9 10 13 14 0 3 5 5 8 10 10 13 15 0 4 5 5 9 10 10 14 15 0
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 15]
Subtask #2:
score: 0
Wrong Answer
Test #12:
score: 9.09091
Accepted
time: 0ms
memory: 3776kb
input:
3
output:
1 2 3
result:
ok accepted
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3860kb
input:
9
output:
1 4 7 2 5 8 3 6 9 1 2 3 4 5 6 7 8 0 1 3 3 4 6 6 7 9 0 2 3 3 5 6 6 8 9 0
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 9]
Subtask #3:
score: 0
Wrong Answer
Test #19:
score: 9.09091
Accepted
time: 0ms
memory: 3640kb
input:
1
output:
result:
ok accepted
Test #20:
score: 0
Wrong Answer
time: 0ms
memory: 3932kb
input:
25
output:
1 9 17 2 10 18 3 11 19 4 12 20 25 1 21 25 9 5 25 17 13 25 2 22 25 10 6 25 18 14 25 3 23 25 11 7 25 19 15 25 4 24 25 12 8 25 20 16 1 2 13 9 10 21 17 18 5 1 3 8 9 11 16 17 19 0 1 4 8 9 12 16 17 20 0 1 5 8 9 13 16 17 21 0 1 6 8 9 14 16 17 22 0 1 7 8 9 15 16 17 23 0 1 8 8 9 16 16 17 24 0 2 3 13 10 11 21...
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 25]
Subtask #4:
score: 0
Wrong Answer
Test #24:
score: 9.09091
Accepted
time: 0ms
memory: 3776kb
input:
7
output:
1 3 5 7 1 6 7 3 2 7 5 4 1 2 4 3 4 6 5 6 2
result:
ok accepted
Test #25:
score: 0
Wrong Answer
time: 0ms
memory: 3940kb
input:
31
output:
1 11 21 2 12 22 3 13 23 4 14 24 5 15 25 31 1 26 31 11 6 31 21 16 31 2 27 31 12 7 31 22 17 31 3 28 31 13 8 31 23 18 31 4 29 31 14 9 31 24 19 31 5 30 31 15 10 31 25 20 1 2 16 11 12 26 21 22 6 1 3 10 11 13 20 21 23 0 1 4 10 11 14 20 21 24 0 1 5 10 11 15 20 21 25 0 1 6 10 11 16 20 21 26 0 1 7 10 11 17 2...
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 31]
Subtask #5:
score: 0
Wrong Answer
Test #29:
score: 0
Wrong Answer
time: 0ms
memory: 3912kb
input:
13
output:
1 5 9 2 6 10 13 1 11 13 5 3 13 9 7 13 2 12 13 6 4 13 10 8 1 2 7 5 6 11 9 10 3 1 3 4 5 7 8 9 11 0 1 4 4 5 8 8 9 12 0 2 3 7 6 7 11 10 11 3 2 4 4 6 8 8 10 12 0 3 4 7 7 8 11 11 12 3
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 13]
Subtask #6:
score: 0
Wrong Answer
Test #34:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
19
output:
1 7 13 2 8 14 3 9 15 19 1 16 19 7 4 19 13 10 19 2 17 19 8 5 19 14 11 19 3 18 19 9 6 19 15 12 1 2 10 7 8 16 13 14 4 1 3 6 7 9 12 13 15 0 1 4 6 7 10 12 13 16 0 1 5 6 7 11 12 13 17 0 1 6 6 7 12 12 13 18 0 2 3 10 8 9 16 14 15 4 2 4 6 8 10 12 14 16 0 2 5 6 8 11 12 14 17 0 2 6 6 8 12 12 14 18 0 3 4 10 9 1...
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 19]
Subtask #7:
score: 0
Wrong Answer
Test #39:
score: 9.09091
Accepted
time: 0ms
memory: 3792kb
input:
3
output:
1 2 3
result:
ok accepted
Test #40:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
27
output:
1 10 19 2 11 20 3 12 21 4 13 22 5 14 23 6 15 24 7 16 25 8 17 26 9 18 27 1 2 9 10 11 18 19 20 0 1 3 9 10 12 18 19 21 0 1 4 9 10 13 18 19 22 0 1 5 9 10 14 18 19 23 0 1 6 9 10 15 18 19 24 0 1 7 9 10 16 18 19 25 0 1 8 9 10 17 18 19 26 0 1 9 9 10 18 18 19 27 0 2 3 9 11 12 18 20 21 0 2 4 9 11 13 18 20 22 ...
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 27]
Subtask #8:
score: 0
Wrong Answer
Test #44:
score: 0
Wrong Answer
time: 0ms
memory: 3920kb
input:
21
output:
1 8 15 2 9 16 3 10 17 4 11 18 5 12 19 6 13 20 7 14 21 1 2 7 8 9 14 15 16 0 1 3 7 8 10 14 15 17 0 1 4 7 8 11 14 15 18 0 1 5 7 8 12 14 15 19 0 1 6 7 8 13 14 15 20 0 1 7 7 8 14 14 15 21 0 2 3 7 9 10 14 16 17 0 2 4 7 9 11 14 16 18 0 2 5 7 9 12 14 16 19 0 2 6 7 9 13 14 16 20 0 2 7 7 9 14 14 16 21 0 3 4 7...
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 21]
Subtask #9:
score: 0
Wrong Answer
Test #49:
score: 0
Wrong Answer
time: 0ms
memory: 3864kb
input:
9
output:
1 4 7 2 5 8 3 6 9 1 2 3 4 5 6 7 8 0 1 3 3 4 6 6 7 9 0 2 3 3 5 6 6 8 9 0
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 9]
Subtask #10:
score: 0
Wrong Answer
Test #54:
score: 0
Wrong Answer
time: 0ms
memory: 3860kb
input:
15
output:
1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 1 2 5 6 7 10 11 12 0 1 3 5 6 8 10 11 13 0 1 4 5 6 9 10 11 14 0 1 5 5 6 10 10 11 15 0 2 3 5 7 8 10 12 13 0 2 4 5 7 9 10 12 14 0 2 5 5 7 10 10 12 15 0 3 4 5 8 9 10 13 14 0 3 5 5 8 10 10 13 15 0 4 5 5 9 10 10 14 15 0
result:
wrong answer Integer parameter [name=c] equals to 0, violates the range [1, 15]
Subtask #11:
score: 0
Skipped
Dependency #1:
0%