QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#123187 | #89. Restore Array | somethingnew | 100 ✓ | 99ms | 3740kb | C++20 | 1.7kb | 2023-07-11 20:42:21 | 2023-07-11 20:42:22 |
Judging History
answer
// ↘ ⬇ ⬇ ⬇ ⬇ ⬇ ↙
// ➡ @roadfromroi ⬅
// ↗ ⬆ ⬆ ⬆ ⬆ ⬆ ↖
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#define all(x) x.begin(), x.end()
using namespace std;
int lgr[5000][5000];
int rgr[5000][5000];
int prfsm1[5001];
int prfempt[5001];
void solve() {
int n, m;
cin >> n >> m;
vector<int> res(n+1, n + 2);
res[0] = 0;
vector<array<int, 3>> edgs;
for (int i = 0; i < n; ++i) {
edgs.push_back({i, i + 1, 1});
edgs.push_back({i + 1, i, 0});
}
for (int i = 0; i < m; ++i) {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (d == 1) {
edgs.push_back({b+1, a, -(b - a + 1 - c + 1)});
//lgr[a][b] = max(lgr[a][b], b - a + 1 - c + 1);
} else {
edgs.push_back({a, b+1, b - a + 1 - c});
//rgr[a][b] = min(rgr[a][b], b - a + 1 - c);
}
}
for (int i = 0; i < n; ++i) {
for (auto [a, b, c] : edgs) {
res[b] = min(res[b], res[a] + c);
}
}
bool ok = 1;
for (auto [a, b, c] : edgs) {
if (res[b] != min(res[b], res[a] + c))
ok = 0;
res[b] = min(res[b], res[a] + c);
}
if (ok == 0) {
cout << "-1\n";return;
}
for (int i = 0; i < n; ++i) {
cout << res[i + 1] - res[i] << ' ';
}
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int t = 1;
while (t--) {
solve();
}
}
詳細信息
Subtask #1:
score: 7
Accepted
Test #1:
score: 7
Accepted
time: 0ms
memory: 3496kb
input:
8 13 0 1 2 1 3 5 1 1 5 7 2 1 0 2 2 0 2 5 3 1 3 7 4 1 2 2 1 0 0 1 1 0 2 7 5 1 2 4 1 0 0 4 2 0 4 5 2 1 1 2 1 0
output:
1 0 0 1 1 1 1 1
result:
ok your plan is correct!
Test #2:
score: 0
Accepted
time: 1ms
memory: 3396kb
input:
7 10 0 3 4 1 2 3 1 0 1 2 2 0 1 3 2 0 0 5 3 0 0 5 5 1 1 4 2 0 2 4 1 0 1 3 3 0 3 5 2 0
output:
1 0 0 0 1 0 1
result:
ok your plan is correct!
Test #3:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
18 190 12 15 3 0 12 12 1 0 11 11 1 0 5 17 3 0 3 4 1 0 1 14 7 0 15 16 1 0 2 13 10 0 4 11 1 0 0 12 2 0 2 10 6 0 6 6 1 0 12 12 1 0 5 8 1 0 2 7 3 0 13 15 2 0 5 14 6 0 14 14 1 0 9 11 1 0 5 17 13 1 6 17 5 0 0 6 1 0 0 9 3 0 10 14 3 0 5 12 1 0 0 17 16 0 0 15 7 0 1 14 8 0 14 16 3 1 1 3 3 1 4 16 11 0 0 16 4 0...
output:
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
result:
ok your plan is correct!
Test #4:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
17 195 12 16 3 1 5 7 3 1 2 10 5 1 5 7 2 1 4 10 7 1 3 9 4 1 8 13 5 1 4 9 2 1 2 7 5 1 1 5 2 1 5 12 3 1 10 13 3 1 5 7 3 1 1 3 3 1 0 9 2 1 3 16 7 1 3 6 3 1 14 16 2 1 3 8 3 1 1 1 1 1 2 15 14 1 1 6 4 1 4 8 1 0 1 2 2 1 4 12 9 1 4 4 1 0 7 13 2 0 2 11 2 0 5 16 2 0 0 3 4 1 9 10 2 1 13 14 2 1 3 8 3 1 11 14 3 1...
output:
1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0
result:
ok your plan is correct!
Test #5:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
18 200 0 17 13 1 0 14 4 0 3 9 1 1 1 6 5 1 8 9 2 1 9 14 3 1 5 15 1 0 10 16 7 1 7 12 3 0 10 17 1 0 1 16 16 1 11 16 5 0 2 15 12 1 4 13 5 0 3 16 10 0 10 16 7 1 4 10 6 1 6 9 1 0 1 12 7 1 4 16 8 0 0 1 1 0 0 12 8 1 1 4 4 1 1 13 8 0 5 14 6 0 7 16 8 1 7 14 4 0 3 15 11 1 0 6 3 1 12 15 3 0 12 15 2 0 4 17 11 1 ...
output:
-1
result:
ok No Solution!
Test #6:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
17 195 0 9 10 1 2 11 1 0 4 6 1 0 4 11 1 0 16 16 1 1 4 5 2 1 0 3 1 1 2 12 5 1 2 13 4 0 8 15 3 1 2 3 2 1 6 12 6 0 5 11 3 1 10 16 4 0 12 13 1 1 3 15 6 1 9 14 6 1 2 10 3 0 1 13 3 1 4 7 1 0 0 4 2 1 0 10 9 1 5 14 5 1 1 6 5 1 5 6 2 1 9 14 5 0 1 6 2 1 0 14 7 0 5 6 1 0 12 14 2 0 2 7 4 0 0 4 4 0 12 14 1 0 1 7...
output:
-1
result:
ok No Solution!
Test #7:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
16 181 6 7 2 1 4 12 2 0 6 12 6 1 8 8 1 0 4 14 3 0 1 12 5 0 15 15 1 1 9 13 4 0 6 7 2 1 2 12 5 0 5 11 7 1 2 4 2 1 4 5 2 1 10 11 2 0 14 14 1 1 9 14 1 0 3 5 2 1 7 11 4 0 6 13 8 1 5 8 4 1 3 11 7 1 3 13 5 0 9 10 2 0 6 11 4 0 3 8 3 0 13 14 2 1 9 11 2 0 5 8 1 0 4 9 4 0 2 2 1 0 1 13 1 0 2 11 5 0 5 14 4 0 0 3...
output:
0 1 0 1 1 0 1 0 0 0 0 0 1 0 1 1
result:
ok your plan is correct!
Test #8:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
16 172 10 15 1 0 11 12 1 0 3 9 5 1 7 11 5 1 8 10 1 0 5 10 4 0 1 15 11 1 9 11 3 0 4 13 7 0 1 3 2 0 5 10 4 0 7 15 8 1 3 11 4 0 9 15 4 0 7 15 6 0 7 10 3 0 7 13 6 0 8 13 6 1 3 9 4 0 5 9 5 1 7 8 1 0 1 14 4 0 10 14 4 0 11 15 2 0 2 13 6 0 6 11 1 0 1 10 10 1 10 12 1 0 2 10 8 1 5 8 3 0 3 11 4 0 10 10 1 0 3 1...
output:
1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1
result:
ok your plan is correct!
Test #9:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
18 198 13 14 1 0 1 5 3 0 7 12 3 1 15 15 1 1 4 15 10 1 8 11 2 1 3 12 3 0 10 15 5 1 0 3 1 0 9 16 1 0 7 7 1 1 10 11 2 1 15 17 1 1 11 16 2 0 10 13 4 1 6 10 5 1 2 11 8 1 2 6 4 1 12 12 1 0 0 9 8 1 11 15 2 0 3 14 12 1 11 14 4 1 1 4 3 0 5 14 9 1 2 9 2 0 2 6 1 0 1 17 13 1 6 15 6 1 3 7 4 1 3 4 2 1 6 9 3 1 7 1...
output:
1 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 1 1
result:
ok your plan is correct!
Test #10:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
17 6 1 1 1 0 2 3 1 0 0 0 1 1 2 13 8 1 6 8 1 0 2 5 2 0
output:
1 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1
result:
ok your plan is correct!
Subtask #2:
score: 13
Accepted
Test #11:
score: 13
Accepted
time: 91ms
memory: 3680kb
input:
4992 9040 331 4442 1 0 3489 4173 1 0 393 4420 1 0 1324 2666 1 0 1317 4131 1 0 399 3010 1 0 1843 4154 1 0 1119 4876 1 0 4216 4980 1 0 2003 4370 1 0 769 1927 1 0 934 3414 1 0 2072 2507 1 0 215 3526 1 0 1493 4107 1 0 539 1643 1 0 2783 4338 1 0 967 1190 1 0 1374 2868 1 0 34 1378 1 0 71 1418 1 0 2120 223...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 1 1 1 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #12:
score: 0
Accepted
time: 95ms
memory: 3696kb
input:
4952 9496 4222 4300 1 0 2892 4392 1 0 4158 4700 1 0 2720 3468 1 0 3002 3114 1 0 1010 4681 1 0 629 4392 1 0 734 2030 1 0 1024 2836 1 0 299 2880 1 0 3728 4858 1 0 1616 2861 1 0 2716 2938 1 0 1265 2892 1 0 1695 1778 1 0 1414 2231 1 0 47 4835 1 0 1554 3489 1 0 2591 3178 1 0 2424 4665 1 0 1089 2460 1 0 2...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 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 0 1 1 ...
result:
ok your plan is correct!
Test #13:
score: 0
Accepted
time: 95ms
memory: 3720kb
input:
4995 9192 257 4428 1 0 2504 2636 1 0 208 4875 1 0 1462 2898 1 0 1000 2298 1 0 4596 4745 1 0 614 4072 1 0 1425 1941 1 0 2378 4165 1 0 496 1556 1 0 255 4838 1 0 76 2176 1 0 349 3143 1 0 1325 4409 1 0 854 3653 1 0 4656 4945 1 0 2957 4396 1 0 784 4891 1 0 4488 4917 1 0 1721 4188 1 0 231 4748 1 0 282 332...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 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 ...
result:
ok your plan is correct!
Test #14:
score: 0
Accepted
time: 90ms
memory: 3740kb
input:
4938 9603 2957 4666 1 0 2348 3586 1 0 3501 3789 1 0 2741 4713 1 0 1217 1254 1 0 192 2857 1 0 1242 2716 1 0 2315 4140 1 0 2464 2912 1 0 189 2590 1 0 4150 4701 1 0 3604 3942 1 0 2491 2801 1 0 1009 2819 1 0 1508 3589 1 0 88 4021 1 0 86 487 1 0 2857 4336 1 0 1738 4473 1 0 1385 1969 1 0 3187 4675 1 0 753...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 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 ...
result:
ok your plan is correct!
Test #15:
score: 0
Accepted
time: 86ms
memory: 3676kb
input:
4923 9528 377 1664 1 0 629 4786 1 0 0 3255 1 0 785 3022 1 1 1009 2063 1 1 3041 4632 1 1 156 3479 1 0 107 4762 1 0 140 1296 1 1 1542 4475 1 0 935 2058 1 0 1230 2832 1 0 2616 2756 1 1 1184 1951 1 0 481 4708 1 0 550 3300 1 0 791 1219 1 0 2423 4289 1 1 1558 2502 1 0 720 2744 1 0 3282 4611 1 1 1795 2077 ...
output:
-1
result:
ok No Solution!
Test #16:
score: 0
Accepted
time: 90ms
memory: 3712kb
input:
4993 9026 407 4008 1 0 1175 3810 1 0 1935 3175 1 0 702 3112 1 0 759 4120 1 0 350 2774 1 1 3711 3813 1 1 1723 2232 1 0 1938 2653 1 1 3780 4873 1 0 1765 4967 1 1 1444 3182 1 1 2189 3485 1 0 1101 1385 1 0 1684 1892 1 1 658 1163 1 0 4143 4382 1 0 2683 4035 1 1 539 4555 1 0 2188 4158 1 0 1081 4527 1 1 42...
output:
-1
result:
ok No Solution!
Subtask #3:
score: 25
Accepted
Dependency #1:
100%
Accepted
Test #17:
score: 25
Accepted
time: 96ms
memory: 3656kb
input:
4938 9881 1814 3083 1 0 2918 2958 41 1 2085 2909 825 1 2595 3342 748 1 1147 2469 1323 1 2697 2734 1 0 407 4791 1 0 568 2847 1 0 2500 2905 1 0 1670 3662 1 0 1692 3400 1709 1 35 436 402 1 1393 2755 1 0 1074 4777 3704 1 552 1519 1 0 3216 3566 351 1 1841 2502 1 0 3 1708 1706 1 90 3062 1 0 1593 2428 1 0 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 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 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 ...
result:
ok your plan is correct!
Test #18:
score: 0
Accepted
time: 96ms
memory: 3680kb
input:
4948 9938 597 2134 1 0 192 2940 2749 1 116 4688 4573 1 449 2324 1 0 3526 4697 1172 1 4178 4738 1 0 4472 4845 1 0 323 1072 1 0 724 4075 3352 1 2828 3622 1 0 712 980 269 1 891 1227 1 0 4117 4895 779 1 419 1627 1 0 927 2579 1653 1 1961 3667 1707 1 1065 3028 1 0 2275 4477 2203 1 3396 3451 56 1 1273 1660...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 1 ...
result:
ok your plan is correct!
Test #19:
score: 0
Accepted
time: 96ms
memory: 3676kb
input:
4957 9852 86 2229 2144 1 838 3854 1 0 177 2427 1 0 1516 2489 974 1 3404 3854 1 0 2667 3472 1 0 260 834 1 0 3096 4769 1674 1 1288 3517 2230 1 60 4378 4319 1 1905 2286 1 0 21 1956 1 0 2956 3222 1 0 122 4000 1 0 4089 4678 590 1 425 4031 3607 1 1424 2198 1 0 1107 1949 843 1 4262 4638 1 0 327 4871 1 0 12...
output:
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 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 0 1 1 ...
result:
ok your plan is correct!
Test #20:
score: 0
Accepted
time: 91ms
memory: 3728kb
input:
4968 9370 2090 2853 1 0 2394 2881 1 0 3912 4279 368 1 850 2352 1 0 2617 4178 1 0 1828 4085 2258 1 1238 1265 1 0 2498 4892 1 0 1921 4034 1 0 3509 4415 907 1 1812 3166 1 0 1562 2316 1 0 1008 2379 1 0 723 3907 1 0 1414 2613 1 0 1076 4475 1 0 2323 4505 2183 1 109 3030 2922 1 1752 3456 1 0 480 4794 4315 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ...
result:
ok your plan is correct!
Test #21:
score: 0
Accepted
time: 94ms
memory: 3680kb
input:
4924 9503 71 756 1 1 1059 3314 1 0 2316 4611 2296 1 1773 2672 900 1 1471 2988 1 0 743 4385 1 0 881 2662 1 0 730 2407 1 0 55 3312 3258 0 29 1524 1496 1 3658 4367 710 1 1678 2706 1 0 2486 2928 443 1 222 3818 3597 1 209 3337 1 1 29 3045 3017 1 1563 3082 1520 0 3188 3333 1 1 2445 4375 1 1 247 952 706 1 ...
output:
-1
result:
ok No Solution!
Test #22:
score: 0
Accepted
time: 95ms
memory: 3684kb
input:
4926 9708 118 3042 2925 1 748 1059 312 1 808 2595 1 1 1177 4325 1 1 2719 3211 1 0 295 2018 1 0 704 3669 2966 1 1465 4818 1 1 2362 4742 1 0 1857 3544 1 0 359 3276 1 1 3586 4611 1026 0 3596 4293 1 1 1731 4563 1 0 1192 1567 376 1 1207 4437 3231 0 3833 4391 559 1 1086 3676 2591 0 2696 3222 1 1 2420 3453...
output:
-1
result:
ok No Solution!
Test #23:
score: 0
Accepted
time: 94ms
memory: 3680kb
input:
4960 9178 1358 2381 1 0 464 2307 1 0 957 2182 1 0 2068 2202 1 0 4561 4629 69 1 772 905 1 0 3767 4844 1078 1 1122 1304 1 0 2324 3588 1 0 1383 2164 1 0 765 4367 1 0 1632 1874 1 0 897 4305 1 0 2420 3713 1294 1 1936 3697 1762 1 460 2374 1915 1 1949 2520 572 1 1889 2806 1 0 444 3289 2846 1 1496 3032 1 0 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #24:
score: 0
Accepted
time: 95ms
memory: 3652kb
input:
5000 10000 0 24 1 1 26 50 1 1 52 76 1 1 78 102 1 1 104 128 1 1 130 154 1 1 156 180 1 1 182 206 1 1 208 232 1 1 234 258 1 1 260 284 1 1 286 310 1 1 312 336 1 1 338 362 1 1 364 388 1 1 390 414 1 1 416 440 1 1 442 466 1 1 468 492 1 1 494 518 1 1 520 544 25 0 546 570 1 1 572 596 1 1 598 622 1 1 624 648 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 your plan is correct!
Test #25:
score: 0
Accepted
time: 91ms
memory: 3612kb
input:
5000 10000 0 4 1 1 6 10 1 1 12 16 1 1 18 22 1 1 24 28 1 1 30 34 1 1 36 40 1 1 42 46 1 1 48 52 1 1 54 58 1 1 60 64 1 1 66 70 1 1 72 76 1 1 78 82 1 1 84 88 1 1 90 94 1 1 96 100 1 1 102 106 1 1 108 112 1 1 114 118 1 1 120 124 5 0 126 130 1 1 132 136 1 1 138 142 1 1 144 148 1 1 150 154 5 0 156 160 1 1 1...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 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 0 0 0 0 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 ...
result:
ok your plan is correct!
Test #26:
score: 0
Accepted
time: 99ms
memory: 3656kb
input:
5000 10000 0 4 5 0 6 10 5 0 12 16 5 0 18 22 5 0 24 28 5 0 30 34 5 0 36 40 5 0 42 46 5 0 48 52 5 0 54 58 5 0 60 64 5 0 66 70 5 0 72 76 5 0 78 82 1 1 84 88 5 0 90 94 5 0 96 100 5 0 102 106 5 0 108 112 5 0 114 118 5 0 120 124 1 1 126 130 5 0 132 136 5 0 138 142 5 0 144 148 5 0 150 154 1 1 156 160 5 0 1...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ...
result:
ok your plan is correct!
Subtask #4:
score: 55
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #27:
score: 55
Accepted
time: 93ms
memory: 3728kb
input:
4937 9156 1795 2822 851 1 788 3467 1087 0 480 1667 1078 1 2069 3900 791 0 84 2355 1434 1 1736 4368 961 0 235 2828 2490 1 1693 4255 2362 1 716 1662 588 1 2659 3019 64 0 469 4498 3770 1 2873 4519 1636 1 1171 4287 1547 0 2839 4788 1027 1 915 1541 382 1 789 2137 573 0 3797 4144 157 0 208 3184 1655 1 317...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ...
result:
ok your plan is correct!
Test #28:
score: 0
Accepted
time: 96ms
memory: 3648kb
input:
4971 9624 1238 3525 2075 1 2231 2891 8 0 646 2652 1809 1 142 1557 751 1 276 504 103 1 562 3628 3052 1 510 1163 571 1 1488 2015 58 0 1768 3845 265 0 308 4291 2906 1 2979 4777 365 0 1756 3805 1863 1 3205 4788 446 0 53 2076 1641 1 1637 4929 2234 1 3112 3372 5 0 420 4649 3438 1 2243 3174 538 1 3193 4243...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #29:
score: 0
Accepted
time: 91ms
memory: 3676kb
input:
4969 9462 571 4657 611 0 655 1901 764 0 766 4754 1164 0 3292 3298 4 0 4078 4374 123 0 385 3348 1034 0 1331 2271 933 1 132 1662 302 0 1265 4896 1850 0 1168 4929 2840 1 2901 4639 486 0 251 2615 1220 0 378 1140 152 0 1576 2197 68 0 3270 3987 612 1 145 287 113 1 2552 4432 285 0 412 2666 1846 1 2583 3229...
output:
1 1 1 1 1 1 1 1 1 1 1 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 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #30:
score: 0
Accepted
time: 92ms
memory: 3712kb
input:
4987 9677 2951 3769 307 0 2764 3693 341 0 4446 4817 61 0 2046 4368 2073 1 1983 2669 149 0 734 2268 947 0 2235 3674 862 0 3981 4810 23 0 246 855 516 1 44 1908 1841 1 1563 3548 1749 1 1843 2813 302 0 3181 3968 103 0 1216 2524 1244 1 426 602 112 0 4088 4961 605 0 516 1705 1013 1 2439 2864 251 0 3207 32...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok your plan is correct!
Test #31:
score: 0
Accepted
time: 93ms
memory: 3676kb
input:
4948 9052 3273 4200 716 1 1038 3216 125 0 3214 3534 149 1 913 3891 1690 1 54 4168 2450 1 2758 4553 1501 1 2185 3653 1056 1 2174 4864 641 0 1112 3238 1274 1 61 783 147 0 904 4665 2524 1 1562 1929 52 0 2367 3988 190 0 53 1339 365 0 1324 1808 351 1 1893 4273 898 1 3405 3414 9 1 1013 2078 283 0 2076 424...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #32:
score: 0
Accepted
time: 94ms
memory: 3668kb
input:
4953 9434 316 1194 696 1 1258 2982 1641 1 2855 4180 1028 1 3737 4549 590 1 541 1499 761 1 1622 2126 82 0 166 1695 1164 1 3572 4493 655 1 3875 4692 681 1 2521 3421 63 0 2812 3473 132 0 646 4523 2143 1 2276 2896 145 0 2215 2918 673 1 2683 3512 114 0 2238 2591 88 1 3756 4222 388 1 700 4785 2524 1 2366 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 1 1 1 1 1 1 1 ...
result:
ok your plan is correct!
Test #33:
score: 0
Accepted
time: 96ms
memory: 3676kb
input:
4986 9757 2136 3947 1598 0 1502 1688 57 0 873 2283 119 1 2261 3689 721 0 1283 2951 1353 1 1732 3885 324 0 832 2254 474 0 1432 2475 214 1 2100 4725 1208 0 2775 3891 815 1 1252 1693 73 1 2299 4884 1021 1 1786 4839 1893 1 239 4304 198 0 552 2514 1882 1 3805 4328 119 1 17 74 19 0 1065 2790 1719 0 1526 2...
output:
-1
result:
ok No Solution!
Test #34:
score: 0
Accepted
time: 95ms
memory: 3644kb
input:
4948 9435 2044 2849 553 1 37 3765 1889 0 2352 3933 530 1 512 3803 546 0 680 4859 2531 1 4322 4408 65 0 1126 2199 72 0 505 2830 1409 0 3799 4400 181 0 1083 2400 57 1 1731 4476 1860 1 3094 3906 503 1 1269 3783 166 1 520 3290 1427 1 3471 3915 236 1 4240 4937 166 0 3849 4640 406 1 563 2190 1324 1 379 12...
output:
-1
result:
ok No Solution!
Test #35:
score: 0
Accepted
time: 95ms
memory: 3624kb
input:
4947 9811 1387 1510 90 1 2158 3372 697 1 3402 3515 98 1 500 2577 2046 1 443 1502 413 0 2385 4144 36 0 3563 4374 737 1 928 2835 826 0 878 2558 1638 1 848 4787 3330 1 2786 3265 196 0 4209 4410 185 1 1619 2285 486 1 4191 4846 267 0 2122 4891 938 0 17 3759 1122 0 3758 4401 372 1 1202 3684 222 0 3052 458...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 ...
result:
ok your plan is correct!
Test #36:
score: 0
Accepted
time: 96ms
memory: 3664kb
input:
4989 9432 575 4705 2244 1 3285 4863 531 0 26 2725 2411 1 2732 3773 138 0 2493 3214 398 1 154 4134 2379 1 1711 4306 656 0 4216 4504 148 1 455 937 279 1 4552 4912 195 1 1235 3927 1831 1 2059 2202 89 1 2724 3359 504 1 1546 4704 2403 1 639 2236 110 0 790 860 28 0 467 4276 822 0 683 4434 3678 1 1082 2316...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 ...
result:
ok your plan is correct!