QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#520824 | #895. Color | do_it_tomorrow | AC ✓ | 88ms | 7808kb | C++14 | 3.8kb | 2024-08-15 16:07:44 | 2024-08-15 16:07:44 |
Judging History
answer
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
const int N=205;
int n,m,c0[N],c1[N],c2[N],col[N][N],vis[N][N];
struct flow {
static constexpr int inf = 1e9;
static const int maxn = 4e2 + 10, maxm = maxn * maxn + maxn * 2 + 10;
int N, S, T;
int to[maxm * 2], val[maxm * 2], nxt[maxm * 2], fir[maxn], tot;
inline flow(int N_, int S_, int T_) {
N = N_, S = S_, T = T_;
}
inline void clear() {
memset(fir, 0, sizeof(fir));
tot = 1;
}
inline void add(int x, int y, int w, bool f = 1) {
to[++tot] = y, val[tot] = w, nxt[tot] = fir[x], fir[x] = tot;
if (f) add(y, x, 0, 0);
}
int hd[maxn], dep[maxn];
inline bool bfs() {
for (int i = 1; i <= N; i++)
hd[i] = fir[i], dep[i] = -1;
dep[S] = 0;
std::queue<int> Q; Q.push(S);
while (! Q.empty()) {
int u = Q.front(); Q.pop();
if (u == T) return true;
for (int i = hd[u]; i; i = nxt[i])
if (dep[to[i]] == -1 && val[i])
dep[to[i]] = dep[u] + 1, Q.push(to[i]);
}
return false;
}
inline int dfs(int u, int fl) {
if (u == T)
return fl;
int ud = 0;
for (int &i = hd[u]; i; i = nxt[i])
if (dep[u] + 1 == dep[to[i]] && val[i]) {
int k = dfs(to[i], std::min(fl - ud, val[i]));
if (! k) dep[to[i]] = -1;
ud += k, val[i] -= k, val[i ^ 1] += k;
if (ud == fl)
return fl;
}
return ud;
}
inline int Dinic() {
int ans = 0, f;
while (bfs())
while ((f = dfs(S, inf)) > 0)
ans += f;
return ans;
}
};
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>n>>m;
if(m%2==0){
cout<<"No\n";
return 0;
}
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
cin>>col[i][j];
col[j][i]=col[i][j];
c2[col[i][j]]++;
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(vis[col[i][j]][i]++){
cout<<"No\n";
return 0;
}
}
for(int j=1;j<=m;j++){
if(!vis[j][i]){
c1[j]++;
}
}
}
for(int i=1;i<=m;i++){
if(c1[i]+c2[i]>(m+1)/2){
cout<<"No\n";
return 0;
}
c0[i]=(m+1)/2-c1[i]-c2[i];
}
int S=m*2+1,T=S+1;
static flow f(m*2+2,S,T);
while (n < m + 1) {
cerr<<n<<endl;
f.clear();
for (int i = 1; i <= m; i++)
f.add(S, i, 1), f.add(m + i, T, 1);
for (int i = 1, hd = m + n + 1, fl = 0; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (! vis[i][j])
f.add(i, m + j, 1);
}
for (int j = 2 * c0[i]; j; j--) {
f.add(i, hd, 1), fl++;
if (fl == m - n + 1) fl = 0, hd++;
}
}
f.Dinic();
for (int i = 1; i <= m; i++) {
int to = -1;
// cerr<<to<<endl;
for (int j = f.hd[i]; j; j = f.nxt[j])
if (! f.val[j])
to = f.to[j];
// std::cerr<<to<<'\n';
if (to <= m + n)
col[to - m][n + 1] = i, vis[i][to - m] = vis[i][n + 1] = 1, c1[i]--;
else
c0[i]--, c1[i]++;
}
n++;
}
cout<<"Yes\n";
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
cout<<col[i][j]<<' ';
}
cout<<'\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5660kb
input:
3 5 1 2 4
output:
Yes 1 2 5 3 4 4 3 2 5 1 5 3 4 2 1
result:
ok ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 5728kb
input:
4 5 1 2 3 3 2 1
output:
No
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
9 11 11 10 3 4 7 5 2 8 2 10 7 4 6 5 1 9 6 3 8 4 11 5 11 2 6 7 10 3 9 2 9 8 5 1 10 3
output:
No
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
12 11 2 11 8 9 1 3 10 7 5 4 6 5 11 10 6 4 9 8 7 1 3 3 8 4 9 7 2 10 6 1 5 2 6 1 4 9 10 7 11 2 6 3 1 7 4 7 8 10 3 9 5 5 1 8 11 10 11 4 3 2 6 5 9 2 11 8
output:
Yes 2 11 8 9 1 3 10 7 5 4 6 5 11 10 6 4 9 8 7 1 3 3 8 4 9 7 2 10 6 1 5 2 6 1 4 9 10 7 11 2 6 3 1 7 4 7 8 10 3 9 5 5 1 8 11 10 11 4 3 2 6 5 9 2 11 8
result:
ok ok
Test #5:
score: 0
Accepted
time: 1ms
memory: 5612kb
input:
3 9 2 8 4
output:
Yes 2 8 4 1 3 7 5 6 9 4 1 3 5 6 8 9 7 7 6 1 3 9 2 5 8 6 9 2 5 3 9 5 4 7 2 2 7 4 8 1 8 4 3 6 1
result:
ok ok
Test #6:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
8 9 8 3 6 9 2 5 7 2 3 1 7 9 5 7 8 6 4 9 4 5 8 2 3 2 6 1 4 3
output:
No
result:
ok ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 5900kb
input:
5 9 2 7 3 8 6 8 4 2 9 1
output:
Yes 2 7 3 8 1 6 4 9 5 6 8 4 3 1 5 7 9 2 9 5 4 1 8 3 1 6 7 9 5 4 7 5 3 2 6 9 2 4 8 8 3 2 6 7 1
result:
ok ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 5724kb
input:
2 9 6
output:
Yes 6 1 2 8 7 3 4 5 9 5 4 3 1 7 2 9 8 7 6 3 2 9 8 4 1 5 9 8 3 6 9 4 5 2 7 8 6 4 2 1 6 5 7 3 1
result:
ok ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 5692kb
input:
7 7 2 5 6 1 7 4 7 5 6 4 3 3 2 1 6 4 2 1 3 7 5
output:
Yes 2 5 6 1 7 4 3 7 5 6 4 3 1 3 2 1 6 4 4 2 1 7 3 7 5 5 6 2
result:
ok ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 5668kb
input:
7 7 2 4 5 6 1 7 3 4 5 6 1 6 1 7 2 7 2 3 3 4 5
output:
Yes 2 4 5 6 1 7 3 3 4 5 6 1 7 6 1 7 2 5 7 2 3 1 3 4 2 5 4 6
result:
ok ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 5700kb
input:
4 11 1 3 9 9 4 7
output:
Yes 1 3 9 4 2 11 7 8 10 6 5 9 4 2 3 7 5 10 11 8 6 7 6 10 5 2 1 8 4 11 10 5 8 6 3 2 11 1 8 3 1 11 5 7 9 1 11 7 6 9 4 9 6 4 2 10 4 3 10 8 9 5 2 1 7 3
result:
ok ok
Test #12:
score: 0
Accepted
time: 1ms
memory: 5956kb
input:
1 11
output:
Yes 1 2 9 7 8 4 5 11 3 6 10 7 5 2 4 3 8 10 6 11 9 1 4 10 5 6 3 9 8 11 10 6 7 3 2 11 4 8 1 9 11 6 8 5 3 11 9 7 5 3 2 1 8 2 10 6 4 10 2 7 1 9 5 7 4 1
result:
ok ok
Test #13:
score: 0
Accepted
time: 41ms
memory: 6140kb
input:
82 199 70 77 112 105 155 100 170 32 185 179 197 164 145 63 166 50 160 30 88 196 2 64 144 42 35 96 27 85 128 44 54 110 175 80 21 154 189 125 86 74 131 106 19 114 18 133 40 13 184 82 89 135 182 117 59 92 137 14 188 20 95 121 183 130 11 46 113 156 153 65 199 56 194 123 52 51 36 49 5 24 34 49 84 77 127 ...
output:
Yes 70 77 112 105 155 100 170 32 185 179 197 164 145 63 166 50 160 30 88 196 2 64 144 42 35 96 27 85 128 44 54 110 175 80 21 154 189 125 86 74 131 106 19 114 18 133 40 13 184 82 89 135 182 117 59 92 137 14 188 20 95 121 183 130 11 46 113 156 153 65 199 56 194 123 52 51 36 49 5 24 34 1 3 8 178 6 4 12...
result:
ok ok
Test #14:
score: 0
Accepted
time: 45ms
memory: 6428kb
input:
72 197 195 140 65 80 45 104 92 126 57 125 157 18 135 117 107 1 172 197 49 142 78 134 52 191 151 181 73 138 150 180 130 93 59 108 188 9 81 51 123 79 178 42 6 17 119 55 118 97 37 22 71 20 36 58 141 165 136 77 30 91 187 190 82 120 129 69 63 2 11 35 19 122 47 62 27 86 74 108 39 107 139 197 117 99 89 180...
output:
Yes 195 140 65 80 45 104 92 126 57 125 157 18 135 117 107 1 172 197 49 142 78 134 52 191 151 181 73 138 150 180 130 93 59 108 188 9 81 51 123 79 178 42 6 17 119 55 118 97 37 22 71 20 36 58 141 165 136 77 30 91 187 190 82 120 129 69 63 2 11 35 19 4 184 170 7 8 3 177 160 168 175 13 193 162 24 10 12 18...
result:
ok ok
Test #15:
score: 0
Accepted
time: 13ms
memory: 6208kb
input:
143 195 82 97 92 117 11 73 21 153 143 63 12 135 4 133 91 60 178 66 76 18 118 1 104 171 106 31 139 187 70 108 179 34 87 85 188 41 101 113 122 191 165 145 121 83 123 159 49 158 164 62 84 126 177 51 7 184 152 19 3 77 10 2 103 95 163 24 107 39 64 67 96 5 80 16 89 102 134 182 14 161 142 99 125 136 109 16...
output:
Yes 82 97 92 117 11 73 21 153 143 63 12 135 4 133 91 60 178 66 76 18 118 1 104 171 106 31 139 187 70 108 179 34 87 85 188 41 101 113 122 191 165 145 121 83 123 159 49 158 164 62 84 126 177 51 7 184 152 19 3 77 10 2 103 95 163 24 107 39 64 67 96 5 80 16 89 102 134 182 14 161 142 99 125 136 109 162 55...
result:
ok ok
Test #16:
score: 0
Accepted
time: 5ms
memory: 6336kb
input:
174 193 79 119 86 42 174 7 101 170 146 44 38 73 50 138 24 14 151 163 148 25 106 173 116 74 67 76 182 193 37 39 131 123 40 137 13 176 97 126 190 142 47 156 6 185 109 3 120 113 90 17 177 32 57 29 100 127 41 33 46 30 186 144 118 58 62 104 48 71 105 191 179 20 72 167 145 102 187 82 98 11 133 2 4 112 169...
output:
Yes 79 119 86 42 174 7 101 170 146 44 38 73 50 138 24 14 151 163 148 25 106 173 116 74 67 76 182 193 37 39 131 123 40 137 13 176 97 126 190 142 47 156 6 185 109 3 120 113 90 17 177 32 57 29 100 127 41 33 46 30 186 144 118 58 62 104 48 71 105 191 179 20 72 167 145 102 187 82 98 11 133 2 4 112 169 157...
result:
ok ok
Test #17:
score: 0
Accepted
time: 62ms
memory: 6492kb
input:
15 191 66 175 49 145 124 75 69 94 101 170 57 141 181 54 186 60 156 135 86 80 105 112 181 68 152 1 65 169 74 53 4 189 23 30 99 177 70 110 174 139 118 69 63 88 95 164 51 135 175 48 23 165 159 184 191 69 147 40 80 144 144 138 163 170 48 126 19 59 123 89 114 121 190 77 161 10 74 108 115 184 71 155 4 68 ...
output:
Yes 66 175 49 145 124 75 69 94 101 170 57 141 181 54 1 2 12 149 171 10 11 87 83 9 61 8 36 35 53 7 167 25 13 23 6 3 182 157 16 188 20 142 19 24 14 18 5 21 17 189 173 144 178 132 26 22 169 176 15 27 4 164 174 28 187 30 31 102 29 168 163 129 161 117 32 177 158 38 40 185 159 33 183 34 42 148 166 147 37 ...
result:
ok ok
Test #18:
score: 0
Accepted
time: 43ms
memory: 6184kb
input:
63 189 105 46 157 174 34 8 64 51 181 61 29 175 135 161 75 150 90 92 154 47 26 156 155 69 97 14 78 164 17 41 15 184 163 152 159 180 54 85 134 132 53 99 3 128 2 39 89 127 88 171 166 7 81 182 31 10 172 162 153 108 114 57 99 21 38 87 61 117 104 45 114 82 39 188 25 128 14 143 145 18 100 79 20 19 122 150 ...
output:
Yes 105 46 157 174 34 8 64 51 181 61 29 175 135 161 75 150 90 92 154 47 26 156 155 69 97 14 78 164 17 41 15 184 163 152 159 180 54 85 134 132 53 99 3 128 2 39 89 127 88 171 166 7 81 182 31 10 172 162 153 108 114 57 1 4 178 13 5 187 148 141 9 6 25 126 119 118 96 16 11 147 18 146 20 186 177 30 23 24 3...
result:
ok ok
Test #19:
score: 0
Accepted
time: 16ms
memory: 6012kb
input:
112 187 180 49 19 105 158 132 103 32 168 31 8 42 178 128 30 62 13 40 150 162 144 172 87 174 97 177 4 175 37 171 135 80 34 46 28 58 54 18 122 136 84 147 15 35 77 63 91 161 170 179 167 38 76 187 36 115 96 146 93 9 25 33 142 109 23 27 44 176 47 90 152 169 131 2 78 102 155 22 154 182 120 98 156 165 53 6...
output:
Yes 180 49 19 105 158 132 103 32 168 31 8 42 178 128 30 62 13 40 150 162 144 172 87 174 97 177 4 175 37 171 135 80 34 46 28 58 54 18 122 136 84 147 15 35 77 63 91 161 170 179 167 38 76 187 36 115 96 146 93 9 25 33 142 109 23 27 44 176 47 90 152 169 131 2 78 102 155 22 154 182 120 98 156 165 53 66 3 ...
result:
ok ok
Test #20:
score: 0
Accepted
time: 14ms
memory: 6136kb
input:
126 185 111 155 67 158 102 139 129 31 4 92 96 25 145 32 66 7 117 108 112 156 143 71 86 101 6 135 46 30 185 146 132 18 10 131 75 93 70 84 98 52 90 21 3 14 61 174 142 157 181 80 22 82 8 161 97 184 44 76 77 1 38 59 167 63 49 162 118 176 178 99 64 128 100 114 41 134 17 57 9 141 119 105 180 35 182 154 19...
output:
Yes 111 155 67 158 102 139 129 31 4 92 96 25 145 32 66 7 117 108 112 156 143 71 86 101 6 135 46 30 185 146 132 18 10 131 75 93 70 84 98 52 90 21 3 14 61 174 142 157 181 80 22 82 8 161 97 184 44 76 77 1 38 59 167 63 49 162 118 176 178 99 64 128 100 114 41 134 17 57 9 141 119 105 180 35 182 154 19 152...
result:
ok ok
Test #21:
score: 0
Accepted
time: 0ms
memory: 7724kb
input:
162 183 173 132 82 107 22 65 83 80 102 171 5 104 119 81 9 151 32 133 116 78 142 131 105 18 6 178 144 21 37 13 54 59 48 167 163 55 35 64 39 137 97 45 74 174 50 92 159 169 153 94 129 130 95 17 73 160 101 85 76 62 14 150 168 112 141 68 180 99 172 120 140 138 177 61 79 29 8 143 84 2 46 60 38 118 139 77 ...
output:
Yes 173 132 82 107 22 65 83 80 102 171 5 104 119 81 9 151 32 133 116 78 142 131 105 18 6 178 144 21 37 13 54 59 48 167 163 55 35 64 39 137 97 45 74 174 50 92 159 169 153 94 129 130 95 17 73 160 101 85 76 62 14 150 168 112 141 68 180 99 172 120 140 138 177 61 79 29 8 143 84 2 46 60 38 118 139 77 136 ...
result:
ok ok
Test #22:
score: 0
Accepted
time: 26ms
memory: 6084kb
input:
89 181 105 176 72 16 98 52 51 108 160 7 134 32 144 128 88 123 20 129 152 122 126 110 171 25 130 19 151 21 101 181 76 114 58 27 28 111 178 113 22 56 104 79 60 64 33 3 157 139 6 85 143 50 8 103 5 71 14 115 180 80 97 117 37 57 10 138 69 132 30 48 141 164 166 148 179 159 75 149 162 118 175 87 11 133 24 ...
output:
Yes 105 176 72 16 98 52 51 108 160 7 134 32 144 128 88 123 20 129 152 122 126 110 171 25 130 19 151 21 101 181 76 114 58 27 28 111 178 113 22 56 104 79 60 64 33 3 157 139 6 85 143 50 8 103 5 71 14 115 180 80 97 117 37 57 10 138 69 132 30 48 141 164 166 148 179 159 75 149 162 118 175 87 11 133 24 70 ...
result:
ok ok
Test #23:
score: 0
Accepted
time: 27ms
memory: 6456kb
input:
87 181 160 140 120 60 115 63 179 148 17 53 126 3 58 55 178 76 139 33 94 86 117 111 29 161 14 48 62 97 106 132 77 170 155 127 28 16 31 153 136 83 18 147 22 59 67 176 151 87 172 40 39 30 142 32 21 95 54 42 105 78 85 45 9 91 110 181 175 101 167 65 81 64 2 146 92 66 75 99 157 80 8 72 116 149 174 163 94 ...
output:
Yes 160 140 120 60 115 63 179 148 17 53 126 3 58 55 178 76 139 33 94 86 117 111 29 161 14 48 62 97 106 132 77 170 155 127 28 16 31 153 136 83 18 147 22 59 67 176 151 87 172 40 39 30 142 32 21 95 54 42 105 78 85 45 9 91 110 181 175 101 167 65 81 64 2 146 92 66 75 99 157 80 8 72 116 149 174 163 5 1 16...
result:
ok ok
Test #24:
score: 0
Accepted
time: 32ms
memory: 6124kb
input:
105 199 169 119 3 158 156 112 12 34 89 83 43 191 4 94 28 17 87 30 5 168 182 76 192 56 181 33 189 82 35 107 97 63 8 52 68 117 196 1 173 32 57 98 139 67 134 125 6 165 54 176 93 31 62 42 10 135 199 86 36 153 114 7 91 95 20 118 157 144 23 146 51 44 162 71 11 110 194 164 150 47 171 90 187 145 126 184 29 ...
output:
Yes 169 119 3 158 156 112 12 34 89 83 43 191 4 94 28 17 87 30 5 168 182 76 192 56 181 33 189 82 35 107 97 63 8 52 68 117 196 1 173 32 57 98 139 67 134 125 6 165 54 176 93 31 62 42 10 135 199 86 36 153 114 7 91 95 20 118 157 144 23 146 51 44 162 71 11 110 194 164 150 47 171 90 187 145 126 184 29 122 ...
result:
ok ok
Test #25:
score: 0
Accepted
time: 12ms
memory: 6092kb
input:
141 191 3 80 104 142 19 97 58 63 134 68 59 14 13 35 154 85 33 112 83 23 190 144 51 1 119 185 72 32 103 129 96 151 176 71 5 75 22 78 124 34 141 69 136 42 70 160 76 7 191 57 110 156 11 26 161 111 93 6 84 36 12 169 46 118 135 179 27 92 41 38 152 28 100 172 43 18 121 138 25 186 79 8 4 53 147 178 180 125...
output:
Yes 3 80 104 142 19 97 58 63 134 68 59 14 13 35 154 85 33 112 83 23 190 144 51 1 119 185 72 32 103 129 96 151 176 71 5 75 22 78 124 34 141 69 136 42 70 160 76 7 191 57 110 156 11 26 161 111 93 6 84 36 12 169 46 118 135 179 27 92 41 38 152 28 100 172 43 18 121 138 25 186 79 8 4 53 147 178 180 125 77 ...
result:
ok ok
Test #26:
score: 0
Accepted
time: 49ms
memory: 7808kb
input:
57 199 141 192 97 102 69 87 106 149 46 146 100 48 125 43 25 143 40 58 176 76 145 93 197 42 11 8 110 112 167 160 30 92 134 90 73 136 162 163 84 68 170 70 39 116 91 77 14 199 130 107 179 183 119 86 20 65 79 159 104 113 61 55 194 179 174 85 184 158 39 169 102 51 157 44 67 87 142 167 183 81 97 181 83 12...
output:
Yes 141 192 97 102 69 87 106 149 46 146 100 48 125 43 25 143 40 58 176 76 145 93 197 42 11 8 110 112 167 160 30 92 134 90 73 136 162 163 84 68 170 70 39 116 91 77 14 199 130 107 179 183 119 86 20 65 1 4 2 7 10 16 168 5 175 3 12 6 159 9 169 150 19 140 17 126 111 128 147 15 13 22 24 88 101 83 184 28 1...
result:
ok ok
Test #27:
score: 0
Accepted
time: 13ms
memory: 6452kb
input:
121 187 103 83 37 1 74 154 135 180 19 120 96 23 126 73 130 34 139 87 58 137 66 105 20 92 32 89 91 163 67 112 147 72 142 125 94 118 116 48 49 113 69 93 185 160 184 55 46 152 165 36 174 127 186 54 44 27 7 151 63 86 8 39 181 122 110 102 64 143 144 108 53 187 133 88 145 167 12 2 6 4 148 158 35 173 109 1...
output:
Yes 103 83 37 1 74 154 135 180 19 120 96 23 126 73 130 34 139 87 58 137 66 105 20 92 32 89 91 163 67 112 147 72 142 125 94 118 116 48 49 113 69 93 185 160 184 55 46 152 165 36 174 127 186 54 44 27 7 151 63 86 8 39 181 122 110 102 64 143 144 108 53 187 133 88 145 167 12 2 6 4 148 158 35 173 109 17 17...
result:
ok ok
Test #28:
score: 0
Accepted
time: 15ms
memory: 6232kb
input:
111 183 28 24 3 21 165 77 8 167 95 118 154 127 36 66 38 54 43 23 98 183 64 146 178 153 125 155 131 166 115 103 130 4 50 13 9 96 144 7 108 69 150 109 30 70 168 90 61 162 112 34 15 147 16 31 76 60 121 83 151 88 17 113 182 126 138 80 143 139 29 134 10 174 55 18 107 14 79 94 11 39 159 35 22 2 149 81 136...
output:
Yes 28 24 3 21 165 77 8 167 95 118 154 127 36 66 38 54 43 23 98 183 64 146 178 153 125 155 131 166 115 103 130 4 50 13 9 96 144 7 108 69 150 109 30 70 168 90 61 162 112 34 15 147 16 31 76 60 121 83 151 88 17 113 182 126 138 80 143 139 29 134 10 174 55 18 107 14 79 94 11 39 159 35 22 2 149 81 136 86 ...
result:
ok ok
Test #29:
score: 0
Accepted
time: 50ms
memory: 6256kb
input:
44 193 161 149 68 4 64 31 191 76 17 193 96 16 24 101 123 87 170 133 33 39 52 163 132 102 86 63 166 10 1 62 168 106 160 155 190 158 129 187 100 71 36 114 59 95 126 68 120 12 116 57 153 60 124 27 5 46 56 7 20 24 25 138 50 47 43 22 144 96 123 84 145 97 183 53 67 41 104 122 106 30 143 175 64 133 65 120 ...
output:
Yes 161 149 68 4 64 31 191 76 17 193 96 16 24 101 123 87 170 133 33 39 52 163 132 102 86 63 166 10 1 62 168 106 160 155 190 158 129 187 100 71 36 114 59 2 5 172 6 9 174 151 12 13 150 147 8 128 153 14 121 15 11 18 20 7 122 179 93 72 54 108 19 25 43 181 173 27 21 26 157 23 30 3 180 34 29 138 28 159 32...
result:
ok ok
Test #30:
score: 0
Accepted
time: 33ms
memory: 7792kb
input:
88 197 69 161 16 148 97 108 46 4 183 7 43 177 123 168 5 59 13 140 6 164 122 139 125 27 25 70 77 55 76 156 94 118 137 131 37 104 154 62 83 138 17 115 188 160 14 133 149 153 135 88 180 12 38 173 151 18 24 22 196 170 23 89 68 20 75 66 87 134 60 73 166 195 110 113 111 26 78 159 179 186 129 121 92 155 10...
output:
Yes 69 161 16 148 97 108 46 4 183 7 43 177 123 168 5 59 13 140 6 164 122 139 125 27 25 70 77 55 76 156 94 118 137 131 37 104 154 62 83 138 17 115 188 160 14 133 149 153 135 88 180 12 38 173 151 18 24 22 196 170 23 89 68 20 75 66 87 134 60 73 166 195 110 113 111 26 78 159 179 186 129 121 92 155 100 1...
result:
ok ok
Test #31:
score: 0
Accepted
time: 54ms
memory: 6400kb
input:
38 195 70 32 57 147 188 103 44 59 19 108 67 14 180 186 63 8 154 133 3 170 28 162 38 27 58 155 121 137 84 73 15 148 143 18 49 172 110 150 108 90 112 54 148 64 100 184 20 163 129 40 128 83 89 194 32 175 183 43 8 182 165 132 6 139 16 88 67 11 56 2 7 45 137 183 145 144 138 75 29 149 125 3 108 184 97 69 ...
output:
Yes 70 32 57 147 188 103 44 59 19 108 67 14 180 186 63 8 154 133 3 170 28 162 38 27 58 155 121 137 84 73 15 148 143 18 49 172 110 6 1 11 2 5 164 151 10 187 146 9 132 13 177 117 111 105 12 4 182 166 173 160 183 158 17 26 7 25 20 130 29 21 23 24 102 22 178 168 176 16 189 31 165 30 34 161 169 33 149 16...
result:
ok ok
Test #32:
score: 0
Accepted
time: 4ms
memory: 5960kb
input:
167 185 9 64 91 14 161 37 11 112 67 48 7 89 34 162 166 175 146 86 117 17 182 40 158 42 160 139 177 151 99 59 47 90 144 26 128 8 87 43 123 20 83 124 97 60 127 6 92 145 77 121 31 62 120 10 82 104 183 44 39 72 28 71 36 149 24 29 103 165 55 18 30 155 66 163 168 159 58 52 85 181 4 27 98 180 126 185 147 1...
output:
Yes 9 64 91 14 161 37 11 112 67 48 7 89 34 162 166 175 146 86 117 17 182 40 158 42 160 139 177 151 99 59 47 90 144 26 128 8 87 43 123 20 83 124 97 60 127 6 92 145 77 121 31 62 120 10 82 104 183 44 39 72 28 71 36 149 24 29 103 165 55 18 30 155 66 163 168 159 58 52 85 181 4 27 98 180 126 185 147 118 1...
result:
ok ok
Test #33:
score: 0
Accepted
time: 88ms
memory: 6672kb
input:
1 199
output:
Yes 1 2 134 101 161 3 172 176 68 181 182 184 185 186 187 51 189 178 190 102 153 20 175 126 41 170 9 10 194 167 8 138 188 183 7 24 12 17 13 21 26 35 11 15 6 14 154 18 19 177 158 25 174 164 5 30 27 173 22 191 16 168 150 110 179 149 28 180 195 31 198 29 192 171 4 166 36 32 37 193 151 147 33 155 23 42 1...
result:
ok ok
Test #34:
score: 0
Accepted
time: 0ms
memory: 5656kb
input:
9 11 11 10 3 4 7 5 2 8 2 10 7 4 6 5 1 9 6 3 10 4 11 5 11 2 6 7 10 3 9 2 9 8 5 1 10 3
output:
No
result:
ok ok
Test #35:
score: 0
Accepted
time: 0ms
memory: 5924kb
input:
1 200
output:
No
result:
ok ok
Test #36:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
3 6 1 2 3
output:
No
result:
ok ok