QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#339809 | #895. Color | AC_Automation | AC ✓ | 26ms | 5844kb | C++14 | 3.1kb | 2024-02-27 21:40:22 | 2024-02-27 21:40:24 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define y1 jiajia
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("unroll-loops")
int clr[205][205];
int cnt = 1;
int head[405];
struct edge {
int v, nxt;
ll w;
} a[400005];
void add_edge(int u, int v, ll w) {
++cnt;
a[cnt].v = v;
a[cnt].w = w;
a[cnt].nxt = head[u];
head[u] = cnt;
}
int flr[405];
int cur[405];
bool bfs(int s, int t) {
queue<int> q; q.push(s);
memset(flr, 0, sizeof(flr));
flr[s] = 1;
while (!q.empty()) {
int u = q.front(); q.pop();
cur[u] = head[u];
for (int i = head[u]; i; i = a[i].nxt) {
if (a[i].w && !flr[a[i].v]) {
flr[a[i].v] = flr[u] + 1;
q.push(a[i].v);
}
}
}
return flr[t] > 0;
}
ll dfs(int u, int t, ll lim) {
if (u == t) return lim;
if (!lim) return 0;
ll sum = 0;
for (int &i = cur[u]; i; i = a[i].nxt) {
if (flr[a[i].v] != flr[u] + 1) continue;
if (a[i].w == 0) continue;
ll tq = dfs(a[i].v, t, min(lim, a[i].w));
sum += tq;
lim -= tq;
a[i].w -= tq;
a[i ^ 1].w += tq;
if (lim == 0) return sum;
}
return sum;
}
int cntt[205];
pair<int, int> p[205];
bool hv[205][205];
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int T = 1;
while (T--) {
memset(hv, 0, sizeof(hv));
memset(cntt, 0, sizeof(cntt));
memset(clr, 0, sizeof(clr));
int n, m; cin >> n >> m;
for (int i = 1; i < n; i++) {
for (int j = i + 1; j <= n; j++) {
cin >> clr[i][j];
clr[j][i] = clr[i][j];
cntt[clr[i][j]]++;
hv[i][clr[i][j]] = hv[j][clr[i][j]] = 1;
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int k = j + 1; k <= n; k++) {
if (clr[i][j] == clr[i][k]) {
cout << "No\n";
goto end;
}
}
}
}
if (m % 2 == 0) {
cout << "No\n";
goto end;
}
for (int i = n + 1; i <= m + 1; i++) {
for (int j = 1; j <= m; j++) {
p[j] = {cntt[j], j};
}
sort(p + 1, p + 1 + m);
vector<int> vec;
for (int j = 1; j <= i - 1; j++) {
cntt[p[j].second]++;
vec.push_back(p[j].second);
}
cnt = 1; memset(head, 0, sizeof(head));
int S = m + m + 1, T = m + m + 2;
for (auto x : vec) {
add_edge(S, x, 1);
add_edge(x, S, 0);
}
for (int j = 1; j < i; j++) {
add_edge(j + m, T, 1);
add_edge(T, j + m, 0);
for (auto x : vec) {
if (!hv[j][x]) {
add_edge(x, j + m, 1);
add_edge(j + m, x, 0);
}
}
}
int ans = 0;
while (bfs(S, T)) ans += dfs(S, T, i - 1);
if (ans != i - 1) {
cout << "No\n";
goto end;
}
for (int j = 1; j < i; j++) {
for (int k = head[j + m]; k; k = a[k].nxt) {
if (a[k].w == 1 && a[k].v <= m) {
clr[j][i] = clr[i][j] = a[k].v;
hv[i][a[k].v] = hv[j][a[k].v] = 1;
}
}
}
}
cout << "Yes\n";
for (int i = 1; i <= m; i++) {
for (int j = i + 1; j <= m + 1; j++) {
if (j == m + 1) cout << clr[i][j] << '\n';
else cout << clr[i][j] << ' ';
}
}
end:;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
3 5 1 2 4
output:
Yes 1 2 3 4 5 4 5 3 2 1 5 3 2 4 1
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3976kb
input:
4 5 1 2 3 3 2 1
output:
No
result:
ok ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3844kb
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: 1ms
memory: 3756kb
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: 0ms
memory: 3704kb
input:
3 9 2 8 4
output:
Yes 2 8 1 6 4 7 5 3 9 4 3 7 5 8 1 9 6 5 1 3 9 6 7 2 9 6 2 7 4 8 2 3 8 5 4 1 9 8 7 4 6 5 2 3 1
result:
ok ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3756kb
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: 1ms
memory: 3796kb
input:
5 9 2 7 3 8 6 8 4 2 9 1
output:
Yes 2 7 3 8 5 9 1 4 6 6 8 4 1 7 5 3 9 2 9 3 1 4 8 5 1 4 5 6 9 7 6 3 7 5 2 2 9 7 8 8 6 4 2 3 1
result:
ok ok
Test #8:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
2 9 6
output:
Yes 6 1 3 7 4 2 5 8 9 2 4 8 5 7 1 9 3 5 9 3 8 7 4 6 1 2 9 8 6 7 6 3 4 2 5 1 9 7 8 6 5 4 3 2 1
result:
ok ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3760kb
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: 1ms
memory: 4032kb
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: 3812kb
input:
4 11 1 3 9 9 4 7
output:
Yes 1 3 9 2 10 4 11 7 5 6 8 9 4 5 11 7 3 2 8 10 6 7 6 1 5 2 8 10 4 11 8 2 6 5 11 1 3 10 3 10 4 1 7 11 9 8 6 9 4 7 5 1 3 11 9 2 10 9 8 7 6 5 4 2 3 1
result:
ok ok
Test #12:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
1 11
output:
Yes 1 2 4 7 11 5 3 8 10 6 9 3 5 8 2 7 4 11 6 9 10 6 9 1 8 11 7 4 10 5 10 3 9 2 1 7 8 11 4 6 5 2 1 11 3 10 6 9 8 5 7 1 3 11 2 4 10 9 7 8 5 4 6 3 2 1
result:
ok ok
Test #13:
score: 0
Accepted
time: 20ms
memory: 3988kb
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 159 33 134 94 11...
result:
ok ok
Test #14:
score: 0
Accepted
time: 25ms
memory: 3952kb
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 27 89 131 15 114 8 148 28 67 147 34 110 196 76 194 75 ...
result:
ok ok
Test #15:
score: 0
Accepted
time: 12ms
memory: 3960kb
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: 5792kb
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: 24ms
memory: 3908kb
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 2 21 43 81 116 149 1 24 46 73 99 125 154 187 52 53 84 115 147 22 23 58 130 131 169 17 60 98 140 186 36 126 127 174 31 82 180 183 42 96 12 13 122 182 184 111 112 40 44 107 171 47 177 179 55 191 3 123 146 28 102 61 62 139 30 110 189 76 157 50 135 29...
result:
ok ok
Test #18:
score: 0
Accepted
time: 22ms
memory: 3976kb
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 37 72 56 67 42 30 104 179 80 158 44 45 122 11 167 168 121 136 28 110 4 87 170 65 151 ...
result:
ok ok
Test #19:
score: 0
Accepted
time: 15ms
memory: 3948kb
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: 12ms
memory: 3944kb
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: 3868kb
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: 17ms
memory: 4024kb
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: 17ms
memory: 3880kb
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 122 51...
result:
ok ok
Test #24:
score: 0
Accepted
time: 20ms
memory: 4252kb
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: 11ms
memory: 4020kb
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: 22ms
memory: 5844kb
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 159 9 138 34 80 22 108 128 72 88 173 52 10 12 85 158 35 185 186 63 142 96 175 56 60 140 21 104 188 74...
result:
ok ok
Test #27:
score: 0
Accepted
time: 13ms
memory: 3988kb
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: 11ms
memory: 4168kb
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: 24ms
memory: 3972kb
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 70 92 121 38 41 109 60 128 2 3 61 180 181 50 165 167 93 95 23 25 150 153 88 89 157 32 169 171 48 122 73 74 192 108 186 72 75 154 42 124 13 97 183 1...
result:
ok ok
Test #30:
score: 0
Accepted
time: 22ms
memory: 4236kb
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: 25ms
memory: 4012kb
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 33 35 71 74 161 40 97 157 25 79 130 187 45 96 150 9 64 118 173 90 91 151 72 135 136 65 129 132 1 68 6 7 78 149 26 94 167 46 122 5 81 165 41 156 10 89 60 61 146 37 124 17 ...
result:
ok ok
Test #32:
score: 0
Accepted
time: 2ms
memory: 5828kb
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: 26ms
memory: 3904kb
input:
1 199
output:
Yes 1 2 4 7 11 16 22 29 37 46 56 67 79 92 106 121 137 154 172 191 12 33 55 78 102 127 153 180 9 38 68 99 131 164 198 34 70 107 145 184 25 66 108 151 195 41 87 134 182 32 82 133 185 39 93 149 6 62 120 179 40 104 163 27 91 156 23 157 158 30 101 169 43 116 189 65 141 19 100 176 58 138 103 187 188 75 16...
result:
ok ok
Test #34:
score: 0
Accepted
time: 1ms
memory: 3700kb
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: 1ms
memory: 3812kb
input:
1 200
output:
No
result:
ok ok
Test #36:
score: 0
Accepted
time: 1ms
memory: 3748kb
input:
3 6 1 2 3
output:
No
result:
ok ok