QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#799750 | #8186. Fast Travel Coloring | peimuda | AC ✓ | 34ms | 7496kb | C++11 | 702b | 2024-12-05 17:41:00 | 2024-12-05 17:41:00 |
Judging History
answer
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#define pr pair
#define f first
#define s second
#define ll long long
#define mp make_pair
#define pll pr<ll,ll>
#define pii pr<int,int>
#define piii pr<int,pii>
using namespace std;
const int rk[3]={1,2,4};
int a[1003][1003];
int main()
{
ios_base::sync_with_stdio(0);
int n;
cin>>n;
for(int i=0;i<7;i++) for(int j=0;j<3;j++)
{
int l=(i+rk[j])%7;
for(int k=0;k<n;k++) for(int o=0;o<n;o++)
{
a[i*n+k][l*n+o]=k;
a[l*n+o][i*n+k]=k;
}
}
for(int i=0;i<7*n;i++)
{
for(int j=0;j<7*n;j++)
{
if(i==j) cout<<"0 ";
else cout<<a[i][j]+1<<' ';
}
cout<<endl;
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3744kb
input:
1
output:
0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
2
output:
0 1 1 1 1 1 1 2 1 1 1 2 1 2 1 0 2 2 2 2 1 2 2 2 1 2 1 2 1 2 0 1 1 1 1 1 1 2 1 1 1 2 1 2 1 0 2 2 2 2 1 2 2 2 1 2 1 2 1 2 0 1 1 1 1 1 1 2 1 1 1 2 1 2 1 0 2 2 2 2 1 2 2 2 1 1 1 2 1 2 0 1 1 1 1 1 1 2 2 2 1 2 1 2 1 0 2 2 2 2 1 2 1 2 1 1 1 2 1 2 0 1 1 1 1 1 1 2 2 2 1 2 1 2 1 0 2 2 2 2 1 1 1 2 1 ...
result:
ok ok
Test #3:
score: 0
Accepted
time: 34ms
memory: 7496kb
input:
142
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
3
output:
0 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 2 3 1 2 3 1 0 1 2 2 2 2 2 2 1 2 3 2 2 2 1 2 3 1 2 3 1 1 0 3 3 3 3 3 3 1 2 3 3 3 3 1 2 3 1 2 3 1 2 3 0 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 2 3 1 2 3 1 0 1 2 2 2 2 2 2 1 2 3 2 2 2 1 2 3 1 2 3 1 1 0 3 3 3 3 3 3 1 2 3 3 3 3 1 2 3 1 2 3 1 2 3 0 1 1 1 1 1 1 1 1 1 2 3 1 1 1 ...
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
4
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 1 1 1 1 1 2 3 4 1 2 3 4 1 0 1 1 2 2 2 2 2 2 2 2 1 2 3 4 2 2 2 2 1 2 3 4 1 2 3 4 1 1 0 1 3 3 3 3 3 3 3 3 1 2 3 4 3 3 3 3 1 2 3 4 1 2 3 4 1 1 1 0 4 4 4 4 4 4 4 4 1 2 3 4 4 4 4 4 1 2 3 4 1 2 3 4 1 2 3 4 0 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 1 1 1 1 1 2 3 4 1 2 3 4 1 0 1 1...
result:
ok ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
5
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 1 1 1 1 1 1 2 3 4 5 1 2 3 4 5 1 0 1 1 1 2 2 2 2 2 2 2 2 2 2 1 2 3 4 5 2 2 2 2 2 1 2 3 4 5 1 2 3 4 5 1 1 0 1 1 3 3 3 3 3 3 3 3 3 3 1 2 3 4 5 3 3 3 3 3 1 2 3 4 5 1 2 3 4 5 1 1 1 0 1 4 4 4 4 4 4 4 4 4 4 1 2 3 4 5 4 4 4 4 4 1 2 3 4 5 1 2 3 4 5 1 1 1 1 0 5 5 5 ...
result:
ok ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
6
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 1 1 1 1 1 1 1 2 3 4 5 6 1 2 3 4 5 6 1 0 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 3 4 5 6 2 2 2 2 2 2 1 2 3 4 5 6 1 2 3 4 5 6 1 1 0 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 1 2 3 4 5 6 3 3 3 3 3 3 1 2 3 4 5 6 1 2 3 4 5 6 1 1 1 0 1 1 4 4 4 4 4 4 4 4 4 4 4 4 1 2 3 4 5...
result:
ok ok
Test #8:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
7
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 0 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 3 4 5 6 7 2 2 2 2 2 2 2 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 1 0 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 2 3 4 5 6 7 3 3 3 3 3 3 3 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 1...
result:
ok ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 4104kb
input:
14
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 ...
result:
ok ok
Test #10:
score: 0
Accepted
time: 5ms
memory: 6144kb
input:
49
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 ...
result:
ok ok
Test #11:
score: 0
Accepted
time: 28ms
memory: 7472kb
input:
139
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #12:
score: 0
Accepted
time: 34ms
memory: 7468kb
input:
141
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #13:
score: 0
Accepted
time: 6ms
memory: 6744kb
input:
71
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #14:
score: 0
Accepted
time: 17ms
memory: 7196kb
input:
128
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #15:
score: 0
Accepted
time: 17ms
memory: 6408kb
input:
100
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #16:
score: 0
Accepted
time: 19ms
memory: 6728kb
input:
114
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #17:
score: 0
Accepted
time: 8ms
memory: 6168kb
input:
85
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #18:
score: 0
Accepted
time: 3ms
memory: 5172kb
input:
57
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #19:
score: 0
Accepted
time: 0ms
memory: 6524kb
input:
42
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
result:
ok ok
Test #20:
score: 0
Accepted
time: 2ms
memory: 4428kb
input:
28
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok
Test #21:
score: 0
Accepted
time: 3ms
memory: 6532kb
input:
32
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok
Test #22:
score: 0
Accepted
time: 3ms
memory: 4736kb
input:
37
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ...
result:
ok ok