QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#862080 | #2824. 找树 | operator_ | WA | 1071ms | 89944kb | C++17 | 2.1kb | 2025-01-18 21:43:44 | 2025-01-18 21:44:26 |
Judging History
answer
//Date: 2025-01-18 18:48:18
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define P emplace_back
#define CLEAR(a,v) memset((a),(v),sizeof((a)))
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
//char buf[1<<20],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int rd() {
int s=0,m=0;char ch=getchar();
while(!isdigit(ch)) {if(ch=='-')m=1;ch=getchar();}
while( isdigit(ch)) s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
return m?-s:s;
}
bool MBE;
namespace SOLVER {
const int M=29989,inv2=(M+1)/2;
int qpow(int x,int y=M-2) {int s=1;for(;y;y>>=1,x=x*x%M) if(y&1) s=s*x%M;return s;}
int n,m,w;int a[75][75][(1<<12)+5],ans[(1<<12)+5];char s[15];
inline void FWT(int f[],int op) {
for(int i=1,t=0;t<w;i<<=1,t++) for(int j=0;j<(1<<w);j+=(i<<1)) rep(k,0,i-1) {
if(s[t]=='|') f[i+j+k]=(f[i+j+k]+f[j+k]*op+M)%M;
if(s[t]=='&') f[j+k]=(f[j+k]+f[i+j+k]*op+M)%M;
if(s[t]=='^') {
int X=f[j+k],Y=f[i+j+k],K=(op==1?1:inv2);
f[j+k]=((X+Y)*K%M+M)%M,f[i+j+k]=((X-Y)*K%M+M)%M;
}
}
}
inline int getval(int v) {
int ans=1,fl=1;rep(i,1,n) {
rep(j,i,n) if(a[j][i][v]) {
if(i==j) break;ans*=-1;
rep(k,i,n) swap(a[i][k][v],a[j][k][v]);break;
}
ans=ans*a[i][i][v]%M;int res=qpow(a[i][i][v]);rep(j,i,n) a[i][j][v]=a[i][j][v]*res%M;
rep(j,i+1,n) rep(k,i,n) a[j][k][v]=(a[j][k][v]-a[j][i][v]*a[i][k][v])%M;
}return ans;
}
void MAIN() {
scanf("%d%d%s",&n,&m,s);n--;w=strlen(s);
rep(i,1,m) {
int x=rd()-1,y=rd()-1,v=rd();if(x==y) continue;
a[x][x][v]++,a[y][y][v]++,a[x][y][v]--,a[y][x][v]--;
}
rep(i,1,n) rep(j,1,n) FWT(a[i][j],1);rep(i,0,(1<<w)) ans[i]=getval(i);
FWT(ans,-1);per(i,(1<<w)-1,0) if(ans[i]) {cout<<i<<endl;return;}puts("-1");
}
}
bool MED;
signed main() {
//freopen(".in","r",stdin);freopen(".out","w",stdout);
for(int tt=1;tt;tt--) SOLVER::MAIN();
cerr<<(&MBE-&MED)/1024<<" KB, "<<1000*clock()/CLOCKS_PER_SEC<<" ms\n";
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 870ms
memory: 87652kb
input:
70 100 &&&&&&&&&&&& 59 1 577 11 18 513 41 11 6 7 33 1 25 26 577 3 57 516 28 5 3 13 56 0 2 32 7 66 53 517 42 31 519 41 34 70 37 54 579 24 15 512 70 32 512 51 49 64 55 19 69 3 31 517 24 8 582 44 45 513 47 58 517 47 41 577 33 22 519 57 41 0 70 50 67 3 6 6 14 43 6 21 1 579 32 27 576 62 7 514 39 36 69 12...
output:
-1
result:
ok single line: '-1'
Test #2:
score: 0
Accepted
time: 887ms
memory: 87896kb
input:
70 100 |&&&&|&&&^&& 70 50 200 51 46 9 48 33 163 14 64 137 53 54 96 32 24 160 7 22 8 40 66 192 12 22 74 20 25 66 7 40 97 27 13 192 3 15 96 43 16 195 23 6 74 7 34 33 5 5 98 12 26 99 44 38 8 27 44 32 10 67 42 19 12 234 6 39 65 27 24 8 58 13 106 37 69 32 4 2 163 33 65 168 3 3 107 56 65 8 42 53 137 32 53...
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 922ms
memory: 88160kb
input:
70 5000 ^&&&&|^&^&&| 70 55 35 32 4 2338 1 45 33 69 4 2337 55 51 2338 26 46 2050 8 5 33 16 51 35 32 10 1 18 67 257 12 37 2307 34 6 2051 30 10 33 21 35 2082 4 27 34 12 4 2337 44 34 2082 11 17 2338 1 2 289 22 2 34 39 68 2304 11 48 289 44 26 2080 57 12 2306 69 15 2338 16 65 2 51 67 2048 1 5 291 64 48 28...
output:
2339
result:
ok single line: '2339'
Test #4:
score: 0
Accepted
time: 969ms
memory: 87884kb
input:
70 5000 &|^^^^||^&^& 44 16 0 53 69 0 27 35 1 54 69 1 25 16 15 12 58 45 66 33 2504 55 2 25 33 68 56 39 58 2 66 8 39 30 54 65 43 67 6 38 55 531 11 47 974 33 19 706 3 52 6 38 50 756 39 26 408 52 16 1086 26 3 110 65 28 37 63 30 1 18 44 117 30 4 778 38 42 23 65 48 203 70 42 14 24 39 390 30 17 3 64 62 29 ...
output:
3582
result:
ok single line: '3582'
Test #5:
score: 0
Accepted
time: 914ms
memory: 89944kb
input:
70 5000 |^|&&|&|&&^^ 21 30 91 41 38 827 52 4 429 66 61 101 28 62 416 57 44 124 24 4 572 36 21 175 40 30 2104 18 47 468 22 25 429 3 65 10 22 11 2438 61 22 58 49 43 40 21 6 1573 37 33 340 11 7 1629 50 18 489 55 51 1499 4 2 194 5 45 44 5 59 52 29 12 90 15 40 16 23 2 817 58 34 584 28 69 3269 37 43 255 6...
output:
4071
result:
ok single line: '4071'
Test #6:
score: 0
Accepted
time: 901ms
memory: 88276kb
input:
70 5000 |&&&&&&&^||^ 27 2 3619 3 18 1697 45 25 2859 64 30 3146 37 10 3409 19 21 3183 61 35 2477 57 62 2807 51 18 3143 54 6 1143 54 67 3318 41 31 3845 45 58 2720 12 17 3023 43 48 2461 66 67 1613 41 3 1283 2 23 1695 38 7 2450 33 44 966 13 64 2730 11 53 1447 58 19 3376 19 27 3559 49 46 1433 70 10 1525 ...
output:
4081
result:
ok single line: '4081'
Test #7:
score: 0
Accepted
time: 919ms
memory: 88156kb
input:
70 5000 &^&|^|&^&|&& 20 4 42 54 40 9 24 9 27 60 39 2 54 38 10 13 30 33 15 28 112 35 41 1 61 40 2 43 36 2 43 9 1 6 34 2 67 51 72 36 34 8 68 49 314 62 69 0 36 23 1 53 64 91 7 66 0 12 53 322 17 20 10 40 70 74 5 56 0 64 10 57 34 69 97 56 9 361 24 1 16 37 35 17 30 28 19 23 9 8 31 68 122 29 18 0 5 52 1 39...
output:
2106
result:
ok single line: '2106'
Test #8:
score: 0
Accepted
time: 954ms
memory: 88028kb
input:
70 5000 ^^^|&^&&|||^ 15 59 5 42 43 0 6 60 1 47 46 517 22 59 4 14 18 1 22 61 5 66 29 512 29 2 0 28 34 0 64 39 1 62 67 516 61 17 516 2 33 5 51 53 0 66 40 0 9 56 0 1 24 0 34 30 513 5 38 5 9 42 1 29 1 0 55 11 0 63 32 516 12 46 5 9 55 0 26 60 5 13 42 0 3 11 4 8 6 5 59 19 1 29 50 1 10 44 1 37 27 1 2 38 5 ...
output:
517
result:
ok single line: '517'
Test #9:
score: 0
Accepted
time: 988ms
memory: 88960kb
input:
70 5000 ^^^^|^&^|&^| 24 68 2656 53 20 3694 37 19 651 52 14 2523 34 37 1274 6 45 2965 1 34 742 30 17 3297 27 9 1658 60 43 3045 5 3 826 61 9 2877 6 40 3478 70 53 1014 31 3 3930 33 34 16 70 60 2646 33 1 1910 30 18 1492 61 12 4 1 23 1169 31 63 440 54 4 2717 6 48 2973 44 57 4013 1 12 3821 62 19 1286 5 37...
output:
4095
result:
ok single line: '4095'
Test #10:
score: 0
Accepted
time: 1000ms
memory: 88020kb
input:
70 5000 ^|^^|^|^&|^^ 12 13 128 48 1 2 52 58 66 65 18 256 62 35 130 70 62 2 10 44 384 13 61 0 3 30 128 10 53 2 51 65 2 60 55 0 63 56 66 56 57 2 33 15 0 60 25 0 50 26 0 29 40 2 16 36 2 27 37 386 4 47 194 2 36 0 62 30 450 60 4 2 9 34 0 17 2 450 9 68 2 70 49 2 45 60 130 15 41 0 59 58 0 55 14 322 44 67 6...
output:
450
result:
ok single line: '450'
Test #11:
score: 0
Accepted
time: 983ms
memory: 88424kb
input:
70 5000 ^|^^|^^^^&|| 20 23 18 44 24 16 10 12 16 49 52 513 57 32 19 51 55 0 46 22 3 53 20 17 58 2 19 14 63 0 30 18 530 35 51 3 12 49 0 62 26 0 1 47 3 8 56 0 59 52 2 1 14 1 28 20 19 29 64 18 5 50 1 61 43 513 65 8 19 61 67 18 49 40 2 59 5 1 18 2 17 60 55 3 25 59 0 63 60 515 57 66 17 7 43 1 22 12 512 54...
output:
2579
result:
ok single line: '2579'
Test #12:
score: 0
Accepted
time: 915ms
memory: 87900kb
input:
70 100 &&&^&^&&&^&| 66 46 9 17 44 26 23 17 4 57 7 5 39 8 17 10 62 330 68 27 6 11 28 10 30 6 1167 48 50 1 59 12 10 62 43 2704 33 5 773 16 49 26 56 52 636 54 58 116 22 65 88 69 62 201 18 24 735 61 30 518 20 69 217 14 67 12 36 34 6 16 24 325 32 33 110 25 13 1289 4 32 56 33 1 71 26 33 2 18 51 1 69 54 40...
output:
-1
result:
ok single line: '-1'
Test #13:
score: 0
Accepted
time: 898ms
memory: 86884kb
input:
70 100 &&&&&^|^&&&& 65 50 57 46 58 417 17 45 155 35 28 56 58 35 823 55 29 2007 11 48 32 61 65 25 1 45 47 3 38 434 50 25 9 9 23 23 59 23 29 30 14 640 4 20 196 21 21 881 66 58 147 49 14 621 4 34 95 26 46 242 45 15 221 31 39 639 40 29 385 43 7 263 49 9 9 36 57 39 45 58 328 39 50 70 47 28 252 6 15 79 32...
output:
-1
result:
ok single line: '-1'
Test #14:
score: 0
Accepted
time: 874ms
memory: 87916kb
input:
70 100 &&|&&&|&&&|& 23 34 2844 56 17 2061 40 69 3004 55 35 2651 55 34 2357 48 56 2876 23 65 1395 50 29 3265 64 49 3467 1 43 4030 8 43 3818 32 43 2461 33 37 442 9 22 2468 65 63 2605 36 60 1149 40 23 1215 19 14 2755 58 42 963 22 41 1776 29 47 372 6 54 886 70 50 1602 25 56 602 66 67 290 50 25 3754 29 1...
output:
-1
result:
ok single line: '-1'
Test #15:
score: 0
Accepted
time: 886ms
memory: 88164kb
input:
70 100 |^&&&|||&&&| 57 54 31 8 6 13 61 30 397 5 42 11 22 50 7 50 6 124 31 36 1 33 52 2 52 49 430 23 21 110 3 68 35 29 63 0 8 55 22 2 64 368 46 12 559 50 32 1 27 36 1 17 23 0 39 67 5 28 61 10 30 32 297 65 44 547 26 61 47 21 21 504 41 1 292 44 27 2 1 33 3628 65 33 1208 17 6 7 14 63 219 59 9 7 9 60 4 2...
output:
-1
result:
ok single line: '-1'
Test #16:
score: 0
Accepted
time: 883ms
memory: 88548kb
input:
70 100 ^&&&&&&&&&&& 42 31 2344 22 49 107 35 21 234 55 47 1367 2 28 2894 11 56 92 34 52 788 54 48 2312 12 8 2642 43 28 306 19 65 2359 35 70 812 61 69 20 55 41 1976 57 25 1544 4 41 8 27 41 103 14 23 234 3 62 79 48 1 453 14 50 38 12 7 3138 24 57 1637 18 70 451 67 66 735 42 34 69 10 63 30 60 38 397 59 5...
output:
-1
result:
ok single line: '-1'
Test #17:
score: 0
Accepted
time: 970ms
memory: 87836kb
input:
70 100 |^&|&^^^^^|| 35 52 8 6 21 131 29 44 2186 68 49 2688 50 55 2698 8 28 2570 24 23 521 60 18 649 36 16 650 46 14 9 7 54 2690 23 65 2562 19 64 643 25 44 2699 34 60 515 24 12 2689 6 45 139 13 8 643 20 20 2178 24 62 2688 38 40 2178 24 47 2699 59 35 520 6 43 521 43 4 2051 38 61 640 29 36 2690 36 55 1...
output:
-1
result:
ok single line: '-1'
Test #18:
score: 0
Accepted
time: 974ms
memory: 87596kb
input:
70 100 |^&|&^^|^^^& 44 6 132 5 65 15 7 15 0 45 8 0 62 65 4 24 39 872 56 36 5 1 51 318 60 18 8 43 37 32 21 44 0 7 21 1324 11 23 179 18 26 1 2 2 2 26 49 326 11 34 357 3 68 2201 50 62 0 63 50 2068 69 64 3985 55 47 43 2 60 55 70 12 0 48 36 6 32 3 9 65 60 9 30 6 115 33 25 822 25 33 14 22 54 131 24 27 716...
output:
-1
result:
ok single line: '-1'
Test #19:
score: 0
Accepted
time: 987ms
memory: 88164kb
input:
70 100 ^^&^^^||^&&^ 60 25 80 3 56 17 5 56 1089 61 34 320 24 38 256 27 14 336 26 65 1025 26 20 16 47 58 64 63 67 16 2 67 16 63 67 17 26 13 1089 33 41 0 31 58 80 50 63 64 43 12 1297 59 59 320 5 44 17 36 68 257 53 30 0 48 1 336 50 50 16 17 66 17 29 17 1025 49 26 257 5 20 0 22 65 0 43 10 1 3 32 64 28 38...
output:
-1
result:
ok single line: '-1'
Test #20:
score: 0
Accepted
time: 870ms
memory: 88428kb
input:
70 300 &&&&&&&&&&&& 35 67 3197 66 41 652 21 4 1282 20 69 3800 25 51 3551 15 8 2464 53 38 2304 10 17 3541 36 55 2796 42 53 2621 54 6 3624 26 11 1719 25 57 3260 43 46 272 49 62 314 30 6 1014 4 45 1644 60 3 330 25 9 325 36 64 4060 12 50 399 30 55 3288 9 32 2876 45 69 3013 16 58 2372 42 56 841 42 65 140...
output:
512
result:
ok single line: '512'
Test #21:
score: 0
Accepted
time: 863ms
memory: 87896kb
input:
70 100 &&&&&&&&&&&& 68 54 104 43 20 52 40 21 52 35 4 4 19 50 2897 43 28 496 16 47 29 25 58 531 18 46 3 19 20 12 25 3 3921 13 4 760 41 37 351 6 4 8 1 46 1117 12 65 346 50 16 91 28 10 45 25 57 39 1 42 39 53 18 1 33 53 1 48 28 63 58 4 0 40 38 290 62 25 3 36 1 1 19 34 48 18 12 28 57 39 809 29 27 324 22 ...
output:
-1
result:
ok single line: '-1'
Test #22:
score: 0
Accepted
time: 875ms
memory: 87904kb
input:
70 300 &&&&&&&&&&&& 46 63 16 52 52 2 32 8 893 17 1 1701 64 67 8 15 53 1 70 39 18 12 11 1 3 56 79 19 54 490 3 33 0 46 42 51 11 34 0 31 33 383 67 20 3 5 45 3 35 36 0 36 63 6 50 42 163 36 13 4077 2 1 2 39 35 3 60 52 409 15 23 11 31 57 948 12 32 41 12 44 211 1 8 18 46 57 11 7 66 282 14 61 16 51 40 273 2...
output:
0
result:
ok single line: '0'
Test #23:
score: 0
Accepted
time: 870ms
memory: 87900kb
input:
70 300 &&&&&&&&&&&& 45 12 93 67 44 27 64 8 112 19 1 135 33 55 84 30 17 62 37 3 31 43 70 20 69 20 223 48 3 3533 33 16 2323 42 56 74 41 39 295 24 28 450 40 4 4076 8 26 4009 53 23 110 29 6 177 28 7 98 59 6 752 33 59 2913 48 55 117 23 54 1882 3 38 312 67 29 121 54 68 73 69 26 48 13 13 213 52 34 305 56 3...
output:
0
result:
ok single line: '0'
Test #24:
score: 0
Accepted
time: 864ms
memory: 88080kb
input:
70 300 |||||||||||| 22 31 669 8 60 317 36 59 1276 60 30 3964 24 64 463 44 61 260 2 5 1115 20 66 1795 41 36 1680 28 14 1803 19 52 2014 29 42 2276 52 70 1719 55 47 1775 6 37 3912 38 15 41 14 2 2223 23 30 1570 70 44 1748 64 43 2908 50 50 3336 36 41 3082 40 3 826 28 39 3609 1 58 677 25 70 643 65 56 1340...
output:
4095
result:
ok single line: '4095'
Test #25:
score: 0
Accepted
time: 868ms
memory: 88304kb
input:
70 300 |||||||||||| 9 13 168 66 10 2 58 25 112 60 69 1289 21 70 3 37 4 10 18 62 172 53 68 70 64 5 14 6 7 0 3 64 0 19 56 464 42 3 1 64 59 482 52 28 5 14 2 1480 48 3 59 31 18 1855 48 24 1040 2 55 2937 55 19 20 49 57 397 32 17 142 42 28 958 22 14 91 56 4 1 61 48 1853 45 1 2097 6 31 2 6 26 3048 67 37 13...
output:
4095
result:
ok single line: '4095'
Test #26:
score: 0
Accepted
time: 862ms
memory: 88428kb
input:
70 300 |||||||||||| 60 55 25 27 49 521 63 13 9 62 23 8 5 68 768 43 5 0 42 49 792 40 40 8 11 16 257 13 46 536 8 10 768 64 11 529 45 31 1 66 28 776 37 23 1 57 51 1 19 60 16 17 28 25 68 49 257 20 70 1 44 49 24 63 23 520 46 12 16 15 18 793 53 28 16 51 54 9 44 29 17 31 39 520 11 48 280 15 12 1 45 28 9 46...
output:
793
result:
ok single line: '793'
Test #27:
score: 0
Accepted
time: 1065ms
memory: 87892kb
input:
70 300 ^^^^^^^^^^^^ 18 59 127 22 4 2671 44 16 3904 36 55 703 5 66 1473 6 60 1882 50 9 3393 11 9 1732 58 19 810 31 12 663 45 45 4031 67 4 405 63 26 819 18 21 2091 10 6 138 70 23 2777 2 31 2712 7 29 2161 23 32 1334 66 66 2637 39 27 3962 68 66 465 60 12 3205 23 11 3790 26 16 3250 5 63 3468 38 42 4026 3...
output:
4095
result:
ok single line: '4095'
Test #28:
score: 0
Accepted
time: 1064ms
memory: 87908kb
input:
70 300 ^^^^^^^^^^^^ 34 57 1 65 53 1 30 51 1 21 38 0 35 49 0 9 42 1 31 28 0 37 17 33 42 5 0 5 6 128 69 25 1 23 42 129 51 9 1 21 53 1 10 53 0 58 66 0 60 14 1 1 24 0 59 17 33 50 53 1 30 57 1 2 62 32 58 40 0 4 19 33 39 15 160 15 51 0 70 54 161 3 57 1 25 20 129 36 29 33 37 3 0 24 39 161 33 60 1 66 21 128...
output:
161
result:
ok single line: '161'
Test #29:
score: 0
Accepted
time: 1071ms
memory: 87900kb
input:
70 300 ^^^^^^^^^^^^ 20 9 55 31 56 89 39 20 175 48 49 788 63 24 126 20 39 25 6 7 762 23 24 160 55 66 257 43 45 439 20 31 103 9 43 49 6 59 213 65 54 1883 13 41 2798 19 5 3021 60 19 275 2 68 15 8 45 740 51 13 80 28 4 546 18 41 3 28 36 2220 26 35 25 46 48 50 64 29 126 29 13 878 22 19 5 43 65 23 51 21 17...
output:
4095
result:
ok single line: '4095'
Test #30:
score: 0
Accepted
time: 901ms
memory: 87888kb
input:
70 300 &&|&&&^&&&^& 9 35 978 13 67 933 7 4 2827 39 13 376 32 33 1921 35 31 1077 34 50 248 32 7 1332 31 59 3193 46 30 3363 66 35 1718 53 56 552 67 9 2951 70 54 3615 58 58 1389 57 49 3609 29 27 1934 62 50 627 67 6 3043 24 8 2028 43 52 939 56 27 1768 5 64 2657 24 68 1358 36 7 3413 70 28 3773 5 69 1670 ...
output:
3140
result:
ok single line: '3140'
Test #31:
score: 0
Accepted
time: 891ms
memory: 88484kb
input:
70 300 &&&&&^|&|&&& 11 33 2 47 16 103 6 40 38 2 57 40 54 70 841 33 2 0 43 8 440 25 12 1610 48 37 14 48 39 0 21 54 343 4 69 172 47 53 51 47 25 6 31 20 1 25 21 2 36 40 76 28 40 225 2 53 245 19 14 51 31 13 31 30 31 91 32 34 3 5 29 1407 51 10 1 5 47 45 22 31 0 27 16 838 44 21 726 60 60 50 7 18 89 47 28 ...
output:
356
result:
ok single line: '356'
Test #32:
score: 0
Accepted
time: 870ms
memory: 87880kb
input:
70 100 &&&&&&&&&&&& 30 2 191 70 50 1011 50 27 253 35 33 27 35 16 425 33 54 554 39 1 80 49 52 66 64 26 687 15 10 26 31 42 58 25 3 443 65 57 274 63 15 59 36 13 689 9 40 186 45 34 122 45 65 120 21 5 130 30 68 1110 48 22 424 17 66 36 39 38 108 24 6 717 43 17 177 33 30 2187 70 60 588 5 62 46 41 49 595 47...
output:
-1
result:
ok single line: '-1'
Test #33:
score: 0
Accepted
time: 886ms
memory: 88560kb
input:
70 300 ^&&||&&&&|&& 54 8 148 15 41 31 40 36 921 41 10 409 5 12 148 58 51 157 18 67 667 8 58 901 41 2 10 36 66 896 9 52 271 67 55 10 53 40 17 7 37 26 16 51 17 7 8 772 30 21 394 68 59 645 24 16 786 45 42 3 36 27 513 30 14 1 46 29 387 60 54 2187 32 21 141 41 30 534 42 42 647 1 57 144 41 57 401 59 56 29...
output:
539
result:
ok single line: '539'
Test #34:
score: 0
Accepted
time: 959ms
memory: 87892kb
input:
70 300 &&^&^^&|&^|^ 26 69 131 63 32 130 19 58 0 36 44 0 21 39 3 8 34 2 67 8 1 31 38 128 58 52 5 16 4 4 61 15 0 44 5 6 27 59 129 45 5 2 17 39 131 67 21 7 66 49 1 48 70 1 62 68 6 42 70 5 44 14 128 45 33 3 45 33 133 67 55 2 16 29 6 25 44 129 10 21 129 35 63 6 67 49 130 27 14 1 46 9 6 51 10 1 42 66 4 64...
output:
132
result:
ok single line: '132'
Test #35:
score: 0
Accepted
time: 954ms
memory: 88544kb
input:
70 300 &|^&&^&&^^^& 64 57 126 58 15 556 54 8 1 33 47 73 9 43 5 20 53 7 57 59 7 52 44 1 18 17 1658 20 35 358 18 60 0 8 1 0 5 32 293 50 11 26 33 1 48 63 57 251 37 55 76 35 21 427 27 48 3100 10 70 7 37 41 196 61 38 1 39 36 1 34 59 417 24 33 10 66 41 1 63 15 467 33 18 18 7 28 65 10 68 0 24 21 134 46 33 ...
output:
1831
result:
ok single line: '1831'
Test #36:
score: 0
Accepted
time: 968ms
memory: 87892kb
input:
70 300 ^^^|^^&|^&&& 36 42 1960 55 57 12 66 46 25 27 37 74 9 32 102 24 40 70 7 19 90 21 35 88 62 25 2225 50 54 321 55 65 152 19 63 107 61 69 240 31 61 23 62 26 1273 11 3 28 44 43 453 12 14 391 14 63 443 65 49 362 39 44 2 57 51 45 14 52 9 13 11 174 23 11 1034 10 59 91 35 30 685 39 2 229 35 3 61 13 56 ...
output:
447
result:
ok single line: '447'
Test #37:
score: 0
Accepted
time: 1005ms
memory: 87892kb
input:
70 300 ^^^^&|^&^^|^ 26 12 755 28 45 2296 5 51 3715 25 33 3577 57 40 3629 7 10 2316 9 33 483 34 29 3150 5 10 3817 5 52 2452 19 43 3908 54 59 3809 9 27 3900 48 59 1342 12 10 518 7 34 3800 44 55 1620 32 42 2646 9 15 2476 31 23 1187 5 65 1572 31 55 519 36 59 796 38 29 887 30 7 536 20 54 2511 54 52 155 1...
output:
3951
result:
ok single line: '3951'
Test #38:
score: 0
Accepted
time: 984ms
memory: 88304kb
input:
70 300 |^^^^^^&&&^& 9 35 1024 21 11 164 29 21 32 31 36 40 45 69 0 23 25 12 54 66 140 45 68 1028 51 64 128 31 1 4 13 66 40 8 31 4 63 34 132 22 64 4 10 54 0 19 50 12 2 53 8 51 23 0 34 68 0 62 18 32 26 69 0 51 34 0 8 38 0 8 2 132 49 38 12 26 15 0 12 59 0 46 61 0 29 8 8 67 59 0 22 67 4 70 36 36 17 32 40...
output:
1068
result:
ok single line: '1068'
Test #39:
score: 0
Accepted
time: 987ms
memory: 89936kb
input:
70 300 |^^|&^^|^&^^ 43 65 16 48 6 272 35 15 0 58 65 17 62 10 273 38 35 1 24 56 17 7 43 0 45 34 16 24 45 16 20 61 0 58 64 257 52 21 17 42 6 16 67 55 1 37 60 17 37 6 0 14 66 256 49 43 17 39 4 17 56 18 1 16 3 0 52 60 17 23 65 272 26 60 273 2 52 0 23 49 17 19 68 257 47 22 1 51 3 1 4 41 1 27 57 1 40 22 0...
output:
257
result:
ok single line: '257'
Test #40:
score: 0
Accepted
time: 870ms
memory: 88348kb
input:
70 500 &&&&&&&&&&&& 59 35 1190 19 22 947 20 34 1135 55 47 2788 6 18 3576 6 50 1558 62 58 2183 69 31 2215 28 38 360 27 17 3532 38 66 2725 17 14 3209 47 34 1592 48 49 1305 63 68 3854 67 45 3856 1 58 3976 3 5 817 33 47 819 51 69 153 5 10 1249 35 34 1559 16 27 500 58 40 1122 67 6 103 31 51 485 27 48 293...
output:
2048
result:
ok single line: '2048'
Test #41:
score: 0
Accepted
time: 871ms
memory: 87888kb
input:
70 500 &&&&&&&&&&&& 14 43 17 28 21 17 19 57 1 46 43 1 11 40 1 41 16 16 50 44 1 2 19 129 34 30 1 64 45 1 12 63 1 23 50 1 59 63 16 66 60 128 31 59 1 13 67 1 70 48 400 44 11 0 5 53 1 64 27 257 18 8 17 17 3 1 29 50 0 23 50 0 15 57 144 44 45 1 21 67 401 70 33 0 28 41 17 51 21 401 60 4 0 26 59 17 4 69 0 4...
output:
16
result:
ok single line: '16'
Test #42:
score: 0
Accepted
time: 869ms
memory: 88492kb
input:
70 500 &&&&&&&&&&&& 34 60 308 22 69 56 24 46 34 15 46 959 44 14 215 47 36 3157 36 35 49 10 6 157 61 17 143 23 22 889 22 67 121 9 49 13 55 64 77 59 50 40 27 54 577 12 42 24 38 61 949 15 58 1074 24 25 753 30 50 1213 65 54 401 41 21 1363 66 32 442 67 21 1740 21 9 632 62 25 21 30 36 247 63 14 290 46 56 ...
output:
128
result:
ok single line: '128'
Test #43:
score: 0
Accepted
time: 866ms
memory: 88544kb
input:
70 100 |||||||||||| 20 42 235 69 65 841 68 60 8 17 45 2067 64 4 1080 25 41 2664 22 32 359 38 26 3178 37 21 2102 32 10 2938 18 26 387 60 33 3279 18 8 1428 10 34 2278 54 29 768 56 55 3837 63 52 995 54 4 3857 43 17 1627 2 23 125 9 59 1613 37 53 3852 44 26 3720 15 15 268 42 45 3503 67 9 3533 45 38 528 5...
output:
-1
result:
ok single line: '-1'
Test #44:
score: 0
Accepted
time: 863ms
memory: 88160kb
input:
70 500 |||||||||||| 25 18 642 35 25 512 65 17 2178 66 13 706 31 61 2754 50 15 2688 68 22 64 50 59 2112 67 62 2 6 20 2688 14 67 2050 24 47 192 55 23 130 45 40 192 39 51 706 1 62 2690 6 66 2624 56 4 642 59 9 512 25 46 64 55 11 2050 19 13 66 16 4 2754 1 61 2560 42 20 2242 15 62 704 61 65 578 67 16 2752...
output:
2754
result:
ok single line: '2754'
Test #45:
score: 0
Accepted
time: 862ms
memory: 88560kb
input:
70 500 |||||||||||| 14 66 117 1 18 3 67 14 1 14 24 1 11 21 3 51 35 7 38 43 79 5 28 80 5 65 1412 1 7 384 30 51 31 47 12 19 61 24 499 66 6 225 4 48 917 57 37 414 5 24 3945 24 63 1 38 20 46 27 12 3603 63 3 126 22 23 63 35 60 0 68 42 14 24 52 244 52 27 10 33 68 1 60 8 100 56 52 1471 48 37 4 49 44 3 47 3...
output:
4095
result:
ok single line: '4095'
Test #46:
score: 0
Accepted
time: 865ms
memory: 88560kb
input:
70 500 |||||||||||| 6 69 4017 13 59 1767 40 61 175 19 49 771 1 54 647 36 20 107 39 65 59 4 64 16 43 35 1582 48 40 94 31 42 1754 21 32 1744 23 69 58 68 23 41 5 40 189 63 37 86 67 52 388 55 55 19 65 40 73 53 23 8 10 68 366 8 25 6 56 14 85 15 38 29 8 51 22 31 58 1473 56 69 192 22 63 390 9 41 1050 18 8 ...
output:
4095
result:
ok single line: '4095'
Test #47:
score: 0
Accepted
time: 1067ms
memory: 88172kb
input:
70 500 ^^^^^^^^^^^^ 28 53 1811 66 50 2481 18 60 476 9 8 683 8 14 304 57 17 3030 56 30 787 49 32 3227 32 4 1777 44 16 566 16 50 2655 50 30 463 25 27 3736 45 59 2727 67 12 3767 1 4 680 41 9 2488 12 49 177 57 22 3090 54 67 2504 41 20 1872 20 61 2234 45 54 1523 54 24 2488 36 30 1368 56 47 2413 16 22 289...
output:
4095
result:
ok single line: '4095'
Test #48:
score: 0
Accepted
time: 1070ms
memory: 88436kb
input:
70 500 ^^^^^^^^^^^^ 65 48 16 3 10 16 23 7 33 29 45 1 7 1 33 61 12 49 49 38 0 57 23 49 55 55 1 20 26 1 2 31 17 42 63 48 21 29 0 33 68 48 58 20 0 10 4 0 57 13 33 2 39 1 24 2 0 32 13 0 38 17 0 43 22 0 27 2 16 5 28 17 21 69 0 9 62 17 59 42 48 4 45 49 7 44 0 34 37 0 68 4 0 10 37 17 42 4 0 65 8 0 46 52 16...
output:
2097
result:
ok single line: '2097'
Test #49:
score: 0
Accepted
time: 1069ms
memory: 87900kb
input:
70 500 ^^^^^^^^^^^^ 63 27 0 18 56 0 25 16 0 4 33 0 14 39 0 3 63 0 37 67 1028 25 42 4 3 22 1028 60 14 4 22 7 4 16 64 0 19 41 4 34 46 0 40 30 4 33 33 4 13 36 0 51 58 0 35 27 4 58 61 0 39 9 0 66 32 0 39 57 4 38 1 4 17 31 1028 56 57 0 59 43 4 30 43 4 52 38 0 39 35 1028 56 65 4 21 9 4 22 4 4 30 59 0 24 5...
output:
1028
result:
ok single line: '1028'
Test #50:
score: 0
Accepted
time: 889ms
memory: 87896kb
input:
70 500 |&|&&&^&&&&| 25 38 2076 39 21 1284 15 2 2328 64 29 2048 46 28 3080 56 38 1300 2 17 2076 55 44 3072 55 22 3328 6 58 3096 62 59 2072 53 1 2324 26 45 20 40 8 16 18 19 3348 32 59 1040 27 11 1048 19 66 1044 40 60 3076 38 20 2332 27 11 1024 24 68 1036 27 14 276 64 23 264 43 63 16 51 3 0 42 45 24 34...
output:
3076
result:
ok single line: '3076'
Test #51:
score: 0
Accepted
time: 924ms
memory: 88240kb
input:
70 500 |&&&&^&|&&^^ 67 68 17 19 30 5 36 37 3 42 26 2 50 44 1 8 51 89 32 21 2 9 47 2610 7 49 1 15 42 1677 7 65 2 25 16 1 23 26 10 23 26 148 16 36 61 11 60 2 38 35 1 49 62 182 8 35 57 24 47 463 7 52 5 62 3 361 30 25 82 7 59 140 70 46 11 56 40 14 11 69 5 39 68 371 59 6 352 61 68 4 13 15 140 17 69 256 6...
output:
3241
result:
ok single line: '3241'
Test #52:
score: 0
Accepted
time: 882ms
memory: 88092kb
input:
70 500 ^&&&&|&&&&&& 28 58 152 57 29 808 10 53 177 3 56 1290 37 2 117 59 45 100 34 30 229 70 4 162 25 17 103 11 2 78 15 42 1570 38 58 134 54 45 36 22 18 466 40 45 4072 25 9 3894 48 2 203 14 12 124 25 34 726 58 39 109 37 17 93 34 26 2566 28 22 965 53 26 253 59 30 838 68 42 69 2 44 11 56 29 73 34 15 66...
output:
289
result:
ok single line: '289'
Test #53:
score: 0
Accepted
time: 923ms
memory: 87868kb
input:
70 500 &&&^^|&&^&&| 29 43 10 20 57 3 57 48 522 54 28 1 39 58 10 2 44 1033 52 12 1537 33 4 3 39 46 3 39 62 521 23 49 1026 61 47 1034 48 66 1537 69 33 514 52 54 1033 9 9 2 60 37 9 35 15 1539 27 14 513 55 10 521 14 39 1546 9 32 1035 7 34 9 45 16 9 65 39 1026 1 31 1539 36 11 1027 29 55 522 49 27 0 9 13 ...
output:
1032
result:
ok single line: '1032'
Test #54:
score: 0
Accepted
time: 869ms
memory: 86504kb
input:
70 100 |||||||||||| 57 22 0 31 36 0 6 43 0 16 40 0 63 42 128 7 44 0 30 64 0 23 4 0 59 51 192 8 43 0 9 37 192 54 53 128 65 21 64 21 50 0 23 54 0 45 18 0 62 47 64 58 39 0 66 46 0 54 57 0 46 65 0 57 60 0 32 41 0 11 59 0 2 1 0 1 42 0 33 58 0 14 53 0 28 31 0 13 36 192 35 3 128 14 10 0 60 27 0 11 64 0 25 ...
output:
-1
result:
ok single line: '-1'
Test #55:
score: 0
Accepted
time: 904ms
memory: 87732kb
input:
70 500 &&^||&&|^&&& 1 13 27 55 12 0 26 24 0 59 36 1 43 52 25 62 33 155 68 55 1 44 56 8 58 17 1 46 11 16 27 22 147 53 68 154 36 13 16 64 65 2064 3 19 10 67 33 11 37 67 2 48 22 2185 62 39 147 35 42 1 31 55 129 53 34 3 43 46 2 15 29 145 37 33 10 35 56 2 31 9 8 67 29 128 41 58 3 44 24 10 6 42 153 38 36 ...
output:
154
result:
ok single line: '154'
Test #56:
score: 0
Accepted
time: 906ms
memory: 87892kb
input:
70 500 ^&^&&&&|&&&& 33 16 62 64 31 1311 4 20 17 58 35 21 51 15 1830 27 4 444 48 2 1322 43 3 507 34 40 12 8 37 565 10 34 1575 62 4 2535 67 69 196 35 52 236 59 4 6 43 28 156 25 68 425 20 55 243 44 7 376 58 12 39 34 58 339 42 18 222 27 51 88 15 70 1043 37 34 282 56 5 218 9 58 4093 45 68 188 60 41 17 51...
output:
165
result:
ok single line: '165'
Test #57:
score: 0
Accepted
time: 954ms
memory: 88288kb
input:
70 500 |^&||||^^^^| 2 21 0 59 60 548 27 16 32 55 63 32 13 22 36 24 14 560 22 15 564 69 37 548 43 35 48 8 40 560 70 29 32 29 2 52 32 31 564 42 39 20 70 61 4 12 31 548 25 41 16 57 17 16 25 13 528 66 14 32 51 56 560 42 27 512 16 14 548 32 23 544 16 37 544 32 17 532 57 15 564 2 2 20 39 28 48 54 12 52 27...
output:
564
result:
ok single line: '564'
Test #58:
score: 0
Accepted
time: 969ms
memory: 88644kb
input:
70 500 &^^^^&^^|||& 9 14 4 41 65 0 26 38 524 46 5 1796 50 57 8 21 67 776 67 36 5 26 48 261 36 70 12 12 52 5 19 69 0 6 55 769 10 34 264 58 12 5 2 40 769 27 27 1 18 24 1 9 33 1 41 44 1 14 59 5 44 39 5 33 52 8 37 60 0 61 67 0 49 30 8 45 43 8 28 57 4 61 67 268 19 52 12 36 59 0 34 9 4 52 15 0 40 9 0 15 5...
output:
1805
result:
ok single line: '1805'
Test #59:
score: 0
Accepted
time: 1006ms
memory: 88568kb
input:
70 500 ^|^^^^^|^^&& 44 20 128 66 47 2 62 45 2186 4 37 136 37 25 0 48 19 128 42 10 128 37 13 8 52 5 8 45 64 2178 2 3 131 43 51 1 47 39 128 41 34 10 22 15 11 2 30 0 58 22 2 65 16 1 1 40 129 40 13 2050 16 16 2 42 5 1 47 2 8 52 32 2058 51 15 130 36 10 137 68 53 2058 63 23 8 34 39 8 28 19 2 1 16 9 26 12 ...
output:
139
result:
ok single line: '139'
Test #60:
score: 0
Accepted
time: 872ms
memory: 87772kb
input:
70 1000 &&&&&&&&&&&& 63 41 1044 66 38 1233 24 14 1217 23 41 1024 27 42 1217 70 46 196 37 15 0 47 16 145 29 60 81 38 27 197 66 50 1157 2 31 1221 46 18 1168 68 54 208 70 12 16 57 34 149 50 60 0 70 2 5 31 21 84 47 33 5 43 27 132 64 44 149 66 9 1025 3 59 1092 46 59 1024 46 32 1232 24 30 1029 48 70 5 12 ...
output:
1216
result:
ok single line: '1216'
Test #61:
score: 0
Accepted
time: 868ms
memory: 88284kb
input:
70 1000 &&&&&&&&&&&& 8 51 760 51 20 151 45 38 334 64 68 68 23 45 0 8 16 2 58 38 4 2 26 1 55 20 7 44 37 4 31 39 1 56 58 2627 35 42 208 56 43 1 60 52 40 20 9 24 41 10 15 22 2 8 18 50 80 46 41 3 57 10 204 42 47 53 22 59 226 26 19 1624 45 22 8 69 12 1 57 25 62 26 42 4021 30 47 2 30 15 365 30 11 2 63 7 0...
output:
128
result:
ok single line: '128'
Test #62:
score: 0
Accepted
time: 874ms
memory: 88040kb
input:
70 1000 &&&&&&&&&&&& 24 16 202 6 61 540 56 31 1660 1 35 2724 12 46 89 14 34 82 4 53 492 45 53 50 26 28 124 19 69 460 20 30 37 28 4 34 28 29 493 44 9 1131 23 60 128 62 4 121 12 19 1498 60 14 27 4 51 1037 52 40 1290 15 21 1002 67 20 37 45 70 339 50 67 116 48 57 61 44 29 33 20 14 130 61 44 355 15 53 33...
output:
1024
result:
ok single line: '1024'
Test #63:
score: 0
Accepted
time: 863ms
memory: 88552kb
input:
70 1000 |||||||||||| 48 14 123 56 59 874 62 70 952 56 40 2829 31 46 1078 44 20 595 1 18 1325 2 14 3854 22 63 3994 52 69 380 39 55 1546 47 43 82 54 65 674 55 62 2357 20 35 2876 55 3 164 40 13 2715 53 2 962 44 11 3132 65 52 286 28 53 2345 18 32 3250 38 55 73 31 53 1365 50 55 1957 6 16 68 52 10 2867 15...
output:
4095
result:
ok single line: '4095'
Test #64:
score: 0
Accepted
time: 862ms
memory: 88172kb
input:
70 1000 |||||||||||| 53 22 0 46 40 0 54 65 1152 64 67 144 64 38 16 25 36 0 41 55 1616 16 54 0 37 67 192 24 43 0 41 32 0 51 8 576 29 32 0 45 28 1168 37 54 0 21 29 80 58 46 1024 53 22 80 19 30 0 23 5 0 50 7 0 14 49 0 69 3 0 34 17 1616 52 14 80 16 54 640 24 50 656 63 3 0 32 3 1216 44 44 192 54 7 0 11 5...
output:
3792
result:
ok single line: '3792'
Test #65:
score: 0
Accepted
time: 867ms
memory: 88036kb
input:
70 100 |||||||||||| 9 61 0 4 34 12 68 6 53 19 25 330 49 29 403 21 20 51 35 32 3898 10 34 3624 49 21 515 1 24 41 39 27 140 8 16 210 57 52 160 46 48 99 18 16 27 33 47 3853 69 55 696 15 70 1629 2 12 400 33 46 10 41 7 46 67 13 366 34 43 1150 40 61 218 50 12 1430 12 64 18 15 25 95 45 1 8 16 41 18 66 6 15...
output:
-1
result:
ok single line: '-1'
Test #66:
score: 0
Accepted
time: 865ms
memory: 88544kb
input:
70 1000 |||||||||||| 34 35 292 40 67 53 10 38 698 56 40 586 20 51 170 1 40 115 28 27 2086 17 67 11 63 44 808 65 62 148 59 11 72 13 64 774 67 5 257 38 33 245 56 56 21 61 49 156 64 46 6 45 37 45 47 21 11 35 12 3005 21 36 868 68 54 42 40 46 635 39 13 19 29 19 969 68 49 299 50 70 2005 20 9 1815 59 25 19...
output:
4095
result:
ok single line: '4095'
Test #67:
score: 0
Accepted
time: 1069ms
memory: 87900kb
input:
70 1000 ^^^^^^^^^^^^ 28 61 2940 3 18 1987 2 64 89 10 38 1765 30 40 1121 70 57 1347 10 39 1642 67 24 2217 10 29 578 14 9 1772 10 16 968 22 63 3759 35 1 1654 30 45 952 62 34 822 48 64 2786 67 33 3172 43 14 297 56 21 3408 10 45 501 62 69 2961 41 39 2237 63 56 510 41 33 3963 21 3 2832 16 40 2289 13 68 2...
output:
4095
result:
ok single line: '4095'
Test #68:
score: 0
Accepted
time: 1065ms
memory: 87852kb
input:
70 1000 ^^^^^^^^^^^^ 44 16 2 46 47 1 17 2 8 15 65 0 13 45 3 17 37 3 49 42 265 36 62 0 51 9 1 42 26 9 40 16 2 58 55 11 38 29 9 31 18 0 29 67 1 26 30 1 33 58 3 36 60 3 65 52 1 44 26 10 35 5 522 54 45 0 39 50 0 49 36 770 35 30 259 9 4 9 43 69 2561 3 47 258 69 46 2 51 63 11 69 67 2306 1 26 2 8 47 8 34 5...
output:
2827
result:
ok single line: '2827'
Test #69:
score: 0
Accepted
time: 1068ms
memory: 88664kb
input:
70 1000 ^^^^^^^^^^^^ 27 65 4 23 45 115 23 55 2457 32 29 206 63 60 92 53 12 499 62 13 17 53 26 71 55 18 464 47 45 79 46 56 56 15 46 209 8 54 2172 28 26 42 30 41 207 2 4 7 22 53 186 45 29 220 23 11 182 45 6 3598 40 8 38 66 38 174 61 66 457 43 15 496 18 4 30 65 27 14 25 54 14 4 15 210 18 45 461 69 65 2...
output:
4095
result:
ok single line: '4095'
Test #70:
score: 0
Accepted
time: 950ms
memory: 87912kb
input:
70 1000 |^^&^&|&|^^| 51 39 3151 16 60 1023 1 65 1623 24 58 1381 6 41 1757 17 55 2639 65 38 1839 46 44 2874 65 35 926 5 51 1324 56 6 673 55 1 2336 14 59 1956 26 22 1700 15 13 35 70 29 3099 10 22 1399 37 7 861 63 40 1355 58 47 2545 51 2 864 47 49 2470 45 41 3053 39 54 1413 33 10 2117 65 46 1698 58 18 ...
output:
4087
result:
ok single line: '4087'
Test #71:
score: 0
Accepted
time: 920ms
memory: 87772kb
input:
70 1000 ^&^&&|^&&&|& 65 28 12 42 60 65 12 61 76 17 15 1 51 61 5 34 3 0 50 36 9 13 35 13 55 43 5 43 27 77 29 7 72 36 18 0 47 69 5 45 9 65 37 68 77 26 58 4 58 33 5 41 17 5 35 70 1 60 7 4 70 61 68 16 34 12 61 51 0 61 4 1 33 5 1 66 41 8 34 3 68 63 48 1 26 63 69 60 66 76 42 37 1 68 57 4 14 26 9 68 65 0 2...
output:
77
result:
ok single line: '77'
Test #72:
score: 0
Accepted
time: 922ms
memory: 89940kb
input:
70 1000 &&^^^&&&&&|& 44 6 2308 70 56 104 60 60 2234 22 61 53 4 60 1708 35 49 197 61 29 277 33 23 36 57 46 152 68 36 81 23 46 179 34 32 985 33 3 18 35 33 567 48 51 53 17 47 1329 1 38 77 33 44 3690 15 66 497 4 42 255 44 13 24 24 43 99 4 2 35 39 18 418 45 38 46 46 52 26 32 53 67 25 58 122 65 28 917 11 ...
output:
1596
result:
ok single line: '1596'
Test #73:
score: 0
Accepted
time: 918ms
memory: 87888kb
input:
70 1000 |&^^&&&&^&&& 57 69 2465 4 36 2360 61 14 2492 58 19 2468 68 56 2062 34 35 2333 10 47 2089 59 69 314 65 43 303 49 63 30 61 49 2449 33 49 45 50 54 155 33 22 318 66 43 2432 60 22 2079 37 35 60 46 52 63 12 14 52 37 49 394 63 66 2225 48 68 2432 64 58 2180 2 26 2181 62 5 56 25 57 2357 51 24 2439 8 ...
output:
2445
result:
ok single line: '2445'
Test #74:
score: 0
Accepted
time: 898ms
memory: 88036kb
input:
70 1000 &&^|&^&&&|&& 45 6 71 65 65 3 23 22 102 21 61 3 32 23 7 11 66 24 5 44 16 46 57 3 36 40 96 45 15 209 6 18 2 22 61 14 18 45 7 40 31 49 45 67 672 56 51 9 1 61 126 15 38 0 16 46 0 26 17 0 70 2 423 34 60 173 19 32 360 28 59 495 61 28 101 8 61 1216 10 38 1 15 65 9 56 10 10 58 31 12 59 11 3 47 64 26...
output:
684
result:
ok single line: '684'
Test #75:
score: 0
Accepted
time: 920ms
memory: 88028kb
input:
70 1000 &&&^^^&&||&& 18 69 70 4 26 30 1 15 102 1 2 269 6 39 2873 33 21 115 12 21 33 44 23 14 37 10 1013 63 63 503 16 1 59 24 44 3 20 62 1626 16 37 19 53 49 1 67 68 9 16 61 287 56 47 1903 70 64 58 46 24 270 50 28 3969 55 43 206 40 59 51 69 60 354 30 61 51 44 36 44 65 50 229 48 41 2299 54 10 2935 64 2...
output:
1848
result:
ok single line: '1848'
Test #76:
score: 0
Accepted
time: 1069ms
memory: 87820kb
input:
70 100 ^^^^^^^^^^^^ 35 7 529 57 63 136 2 15 528 52 44 9 50 13 650 53 29 659 63 36 1 37 57 642 14 62 25 11 29 145 34 17 531 17 65 144 18 20 649 56 3 641 15 62 153 15 6 515 49 3 10 3 32 537 22 69 128 64 49 656 13 65 138 27 66 24 5 69 137 69 3 513 24 38 26 39 51 25 50 31 537 49 41 27 23 4 664 7 47 664 ...
output:
-1
result:
ok single line: '-1'
Test #77:
score: 0
Accepted
time: 970ms
memory: 87772kb
input:
70 1000 ^^&|&^|^^|&^ 60 5 1402 13 48 1820 65 54 3063 7 43 330 19 41 1103 35 16 4052 6 34 9 37 1 2797 13 68 1752 28 34 416 30 11 3514 34 14 2569 49 7 2950 67 24 3194 23 16 3969 51 10 717 19 37 1269 36 52 3734 58 37 1363 22 55 1582 43 33 1283 25 19 2851 18 18 1054 30 16 3987 31 19 2184 53 19 2405 7 64...
output:
4091
result:
ok single line: '4091'
Test #78:
score: 0
Accepted
time: 929ms
memory: 87888kb
input:
70 1000 |||^|&&^&&^^ 8 24 166 47 9 1 62 15 176 7 42 0 16 20 1 30 11 8 1 38 0 44 58 7 61 56 117 33 13 423 58 7 345 13 33 1249 41 16 1 60 9 71 20 9 0 11 28 3430 5 5 494 22 66 126 57 67 408 34 50 3928 4 68 360 34 18 104 38 46 372 36 23 88 2 28 4 45 45 581 33 35 19 23 51 240 38 44 39 55 25 0 48 34 17 66...
output:
3295
result:
ok single line: '3295'
Test #79:
score: 0
Accepted
time: 987ms
memory: 87836kb
input:
70 1000 ^&|^^^^^^&|& 38 50 895 34 37 495 16 15 1859 24 29 101 47 45 437 8 5 199 7 17 806 27 23 32 58 27 59 49 25 54 61 12 185 25 5 21 5 47 979 63 35 513 36 65 464 42 62 459 6 44 1104 56 18 44 30 17 4 7 45 100 6 54 1148 39 46 459 17 68 39 14 62 11 13 9 118 54 45 2740 37 51 2 65 18 782 70 20 225 46 60...
output:
2045
result:
ok single line: '2045'
Test #80:
score: 0
Accepted
time: 869ms
memory: 88036kb
input:
70 2000 &&&&&&&&&&&& 12 12 2283 8 33 643 46 65 1265 1 9 622 24 28 2744 48 41 2925 7 29 3734 44 11 49 69 56 1459 53 27 20 60 37 1620 25 65 1191 8 18 3016 20 30 2630 58 60 1126 5 42 1578 58 12 1552 43 27 560 21 4 597 45 28 4062 46 4 534 70 27 921 62 5 118 52 12 952 58 24 3162 47 28 2866 17 33 1330 58 ...
output:
3584
result:
ok single line: '3584'
Test #81:
score: -100
Wrong Answer
time: 869ms
memory: 88032kb
input:
70 2000 &&&&&&&&&&&& 15 42 32 67 4 1 10 32 33 36 45 33 35 25 0 51 30 1 47 43 0 28 23 1 68 66 544 39 6 17 59 4 1 34 63 16 55 48 33 39 38 65 67 19 1 58 42 17 61 5 48 53 55 97 65 46 0 61 59 0 55 18 112 44 41 33 47 30 113 36 11 1 44 12 0 6 1 0 30 4 64 9 67 0 48 67 17 42 59 0 60 67 0 22 18 609 63 70 0 9 ...
output:
576
result:
wrong answer 1st lines differ - expected: '544', found: '576'