QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#562523 | #8186. Fast Travel Coloring | Afterlife# | AC ✓ | 35ms | 7024kb | C++20 | 1.8kb | 2024-09-13 18:09:56 | 2024-09-13 18:09:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n;
string s[7]={
"0010110",
"1100101",
"0100011",
"1110000",
"0011101",
"0101110",
"1001011"
};
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n;
vector<vector<int> >g(7*n,vector<int>(7*n));
for(int i=0;i<7*n;++i){
for(int j=0;j<7*n;++j){
int u=i%n+1,v=j%n+1;
if(u==v){
cout<<(i==j?0:u)<<' ';
g[i][j]=(i==j?0:u);
}
else{
if(i/n==j/n)
{
if(s[i/n][j/n]=='0')
cout<<(g[i][j]=max(u,v))<<" ";
else
cout<<(g[i][j]=min(u,v))<<" ";
}
else
{
if(s[i/n][j/n]=='0'){
cout<<u<<' ';
g[i][j]=u;
}
else{
cout<<v<<' ';
g[i][j]=v;
}
}
}
}
cout<<'\n';
}
// for(int i=1;i<=n;i++)
// {
// auto f=g;
// for(auto &v:f)
// for(auto &e:v)
// if(e!=i)
// e=0;
// for(int i=0;i<7*n;i++)
// f[i][i]=1;
// auto nf=f;
// for(int i=0;i<7*n;i++)
// for(int j=0;j<7*n;j++)
// for(int k=0;k<7*n;k++)
// nf[i][j]|=f[i][k]&f[k][j];
// int ok=1;
// for(int u=0;u<7*n;u++)
// for(int v=0;v<7*n;v++)
// if(!nf[u][v])
// cout<<i<<" "<<u<<" "<<v<<endl;
// }
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
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: 3568kb
input:
2
output:
0 2 1 1 1 2 1 1 1 2 1 2 1 1 2 0 2 2 1 2 2 2 1 2 1 2 2 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 1 1 2 0 2 1 1 1 1 1 2 1 2 2 2 1 2 2 0 2 2 2 2 1 2 1 2 1 2 1 2 1 2 0 2 1 1 1 1 1 1 1 2 1 2 1 2 2 0 2 2 2 2 2 2 1 1 1 1 1 2 1 2 0 1 1 1 1 2 2 2 2 2 1 2 1 2 1 0 2 2 1 2 1 1 1 2 1 ...
result:
ok ok
Test #3:
score: 0
Accepted
time: 31ms
memory: 7024kb
input:
142
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
3
output:
0 2 3 1 1 1 1 2 3 1 1 1 1 2 3 1 2 3 1 1 1 2 0 3 2 2 2 1 2 3 2 2 2 1 2 3 1 2 3 2 2 2 3 3 0 3 3 3 1 2 3 3 3 3 1 2 3 1 2 3 3 3 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 2 2 2 2 2 2 2 1 2 3 2 2 2 1 2 3 1 2 3 1 2 0 3 3 3 3 3 3 1 2 3 3 3 3 1 2 3 1 1 1 1 2 3 0 2 3 1 1 1 1 1 1 1 2 3 1 2 3 ...
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
4
output:
0 2 3 4 1 1 1 1 1 2 3 4 1 1 1 1 1 2 3 4 1 2 3 4 1 1 1 1 2 0 3 4 2 2 2 2 1 2 3 4 2 2 2 2 1 2 3 4 1 2 3 4 2 2 2 2 3 3 0 4 3 3 3 3 1 2 3 4 3 3 3 3 1 2 3 4 1 2 3 4 3 3 3 3 4 4 4 0 4 4 4 4 1 2 3 4 4 4 4 4 1 2 3 4 1 2 3 4 4 4 4 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 2 2...
result:
ok ok
Test #6:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
5
output:
0 2 3 4 5 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 1 1 1 1 2 0 3 4 5 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 2 2 2 2 2 3 3 0 4 5 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 3 3 3 3 3 4 4 4 0 5 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 4 4 4 4 4 5 5 5 5 0 5 5 5 ...
result:
ok ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
6
output:
0 2 3 4 5 6 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 1 1 1 1 1 2 0 3 4 5 6 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 2 2 2 2 2 2 3 3 0 4 5 6 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 3 3 3 3 3 3 4 4 4 0 5 6 4 4 4 4 4 4 1 2 3 4 5 6 4 4 4 4 4...
result:
ok ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
7
output:
0 2 3 4 5 6 7 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 1 1 1 1 1 1 2 0 3 4 5 6 7 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 2 2 2 2 2 2 2 3 3 0 4 5 6 7 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 3 3 3 3 3 3 3 4 4...
result:
ok ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
14
output:
0 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 3 4 5 6 7 8 9 10 11 12 13 14 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 3 4 5 6 7 8 9 10 1...
result:
ok ok
Test #10:
score: 0
Accepted
time: 2ms
memory: 3688kb
input:
49
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 2...
result:
ok ok
Test #11:
score: 0
Accepted
time: 30ms
memory: 6880kb
input:
139
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok ok
Test #12:
score: 0
Accepted
time: 35ms
memory: 7004kb
input:
141
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok ok
Test #13:
score: 0
Accepted
time: 9ms
memory: 4108kb
input:
71
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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: 25ms
memory: 6276kb
input:
128
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok ok
Test #15:
score: 0
Accepted
time: 17ms
memory: 5148kb
input:
100
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1 1 1 1 ...
result:
ok ok
Test #16:
score: 0
Accepted
time: 22ms
memory: 5676kb
input:
114
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok ok
Test #17:
score: 0
Accepted
time: 13ms
memory: 4656kb
input:
85
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 1 1 1 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: 3820kb
input:
57
output:
0 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ...
result:
ok ok
Test #19:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
42
output:
0 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 33 34 35 36 37 38 39 40 41 42 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 33 34 35 36 ...
result:
ok ok
Test #20:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
28
output:
0 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 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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...
result:
ok ok
Test #21:
score: 0
Accepted
time: 2ms
memory: 3964kb
input:
32
output:
0 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok
Test #22:
score: 0
Accepted
time: 3ms
memory: 3920kb
input:
37
output:
0 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 33 34 35 36 37 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 33 34 35 36 37 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok