QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#113146 | #2500. Collecting Stamps 3 | lmeowdn | 100 ✓ | 95ms | 519768kb | C++14 | 2.4kb | 2023-06-16 15:23:38 | 2023-06-16 15:23:39 |
Judging History
answer
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
const int N=405,inf=0x3f3f3f3f3f3f3f3f;
int n,L,d[N],t[N],f[N][N][N>>1],g[N][N][N>>1],ans;
signed main() {
n=read(), L=read();
rep(i,1,n) d[i]=read();
rep(i,1,n) t[i]=read();
rep(i,1,n) d[i+n]=d[i]+L, t[i+n]=t[i];
rep(l,1,2*n) rep(r,1,2*n) rep(x,0,n) f[l][r][x]=g[l][r][x]=inf;
rep(i,1,n) {
int x=(min(d[i],L-d[i])<=t[i]);
f[i][i][0]=f[i+n][i+n][x]=min(d[i],L-d[i]);
f[i][i][x]=f[i+n][i+n][x]=min(d[i],L-d[i]);
g[i][i][0]=g[i+n][i+n][x]=min(d[i],L-d[i]);
g[i][i][x]=g[i+n][i+n][x]=min(d[i],L-d[i]);
}
rep(i,1,n) if(f[i][i][1]<inf) ans=1;
rep(len,2,n) {
rep(l,1,2*n-len+1) {
int r=l+len-1;
rep(x,0,n) {
int yl=((f[l+1][r][x]+d[l+1]-d[l])<=t[l]);
chmin(f[l][r][x+yl],f[l+1][r][x]+d[l+1]-d[l]);
int yr=((g[l][r-1][x]+d[r]-d[r-1])<=t[r]);
chmin(g[l][r][x+yr],g[l][r-1][x]+d[r]-d[r-1]);
}
rep(x,0,n) {
chmin(f[l][r][x],g[l][r][x]+d[r]-d[l]);
chmin(g[l][r][x],f[l][r][x]+d[r]-d[l]);
if(f[l][r][x]<inf) chmax(ans,x);
if(g[l][r][x]<inf) chmax(ans,x);
}
}
}
printf("%lld\n",ans);
return 0;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 1ms
memory: 18060kb
input:
5 180 137 149 164 167 171 18 76 14 55 116
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 1ms
memory: 17960kb
input:
5 198 5 12 18 190 192 16 43 200 33 0
output:
4
result:
ok single line: '4'
Test #3:
score: 0
Accepted
time: 1ms
memory: 28212kb
input:
9 198 3 17 22 33 43 44 48 54 65 0 17 29 32 38 46 45 54 66
output:
5
result:
ok single line: '5'
Test #4:
score: 0
Accepted
time: 1ms
memory: 20052kb
input:
6 171 22 30 46 85 96 149 18 179 19 69 87 96
output:
3
result:
ok single line: '3'
Test #5:
score: 0
Accepted
time: 1ms
memory: 24092kb
input:
7 198 5 8 14 188 191 194 197 7 18 50 69 80 35 8
output:
7
result:
ok single line: '7'
Test #6:
score: 0
Accepted
time: 1ms
memory: 36420kb
input:
12 198 71 72 83 94 108 112 119 140 142 143 166 174 124 119 124 111 91 94 85 48 60 63 40 32
output:
9
result:
ok single line: '9'
Test #7:
score: 0
Accepted
time: 1ms
memory: 24176kb
input:
8 178 32 55 69 99 115 134 152 156 61 109 37 65 76 31 103 0
output:
2
result:
ok single line: '2'
Test #8:
score: 0
Accepted
time: 3ms
memory: 30284kb
input:
10 198 1 2 3 10 14 182 183 190 192 196 0 3 17 46 115 142 79 44 8 1
output:
7
result:
ok single line: '7'
Test #9:
score: 0
Accepted
time: 1ms
memory: 36408kb
input:
12 198 18 23 45 53 54 70 101 103 105 110 118 152 21 24 49 45 61 78 108 111 97 107 122 144
output:
8
result:
ok single line: '8'
Test #10:
score: 0
Accepted
time: 2ms
memory: 7740kb
input:
1 2 1 0
output:
0
result:
ok single line: '0'
Test #11:
score: 0
Accepted
time: 1ms
memory: 7748kb
input:
1 2 1 1
output:
1
result:
ok single line: '1'
Test #12:
score: 0
Accepted
time: 1ms
memory: 36536kb
input:
12 170 1 4 7 28 32 63 84 85 90 94 96 107 116 77 30 93 134 99 190 103 96 189 173 191
output:
12
result:
ok single line: '12'
Test #13:
score: 0
Accepted
time: 1ms
memory: 36472kb
input:
12 200 14 25 35 57 113 120 141 143 146 153 173 179 126 137 127 141 135 134 122 100 164 185 163 188
output:
9
result:
ok single line: '9'
Test #14:
score: 0
Accepted
time: 1ms
memory: 24228kb
input:
7 171 4 31 65 82 125 128 150 1 24 51 55 8 23 18
output:
0
result:
ok single line: '0'
Test #15:
score: 0
Accepted
time: 5ms
memory: 26160kb
input:
8 175 28 41 67 77 89 104 106 138 16 9 0 56 25 39 42 14
output:
0
result:
ok single line: '0'
Test #16:
score: 0
Accepted
time: 1ms
memory: 36412kb
input:
12 13 1 2 3 4 5 6 7 8 9 10 11 12 0 200 200 200 200 200 200 200 200 200 200 200
output:
11
result:
ok single line: '11'
Test #17:
score: 0
Accepted
time: 3ms
memory: 36480kb
input:
12 13 1 2 3 4 5 6 7 8 9 10 11 12 200 200 200 200 200 200 200 200 200 200 200 200
output:
12
result:
ok single line: '12'
Subtask #2:
score: 10
Accepted
Dependency #1:
100%
Accepted
Test #18:
score: 10
Accepted
time: 1ms
memory: 40648kb
input:
14 995216877 1547993 21872568 117017367 130195631 172395048 303811509 316432767 467657618 489836809 577455025 608824907 616559666 696830761 987994277 177587234 629350557 411262955 841625784 194076652 479115452 408683201 364268603 109991323 631975956 373092938 104263243 949468174 778758041
output:
10
result:
ok single line: '10'
Test #19:
score: 0
Accepted
time: 1ms
memory: 30412kb
input:
10 957307325 40526371 60810082 60820390 94278571 207413180 330699274 360357075 397321615 518571948 925010264 9046488 10048815 913320939 270546395 356388769 269607042 444929100 365070745 244210838 525063997
output:
5
result:
ok single line: '5'
Test #20:
score: 0
Accepted
time: 1ms
memory: 34420kb
input:
12 883313120 21829204 37314859 81878430 327591142 441913998 457602296 638182996 701569600 703036538 746679793 749878957 787945504 174062762 824574750 328610501 218823308 285317760 395266065 777626897 143435091 963710877 291722991 400725598 526884305
output:
7
result:
ok single line: '7'
Test #21:
score: 0
Accepted
time: 0ms
memory: 42644kb
input:
14 998374538 55005020 136253295 167840188 209817987 226142739 229002260 261542168 348671858 402488752 403736667 438697153 557394603 610401423 811914415 797134194 197645577 250510705 394957044 463870699 942748546 425910619 172208631 705492158 840453618 74694920 400759184 258764540 940515505
output:
10
result:
ok single line: '10'
Test #22:
score: 0
Accepted
time: 1ms
memory: 28212kb
input:
9 762152627 111917773 134919116 155422008 328301493 333796036 373204294 480675107 546940509 730594645 821492438 709486524 476358560 184207693 334323157 867541572 215296124 311813854 959010325
output:
6
result:
ok single line: '6'
Test #23:
score: 0
Accepted
time: 1ms
memory: 44752kb
input:
15 999999998 1924124 2952838 5239098 18421969 37271499 37853044 47082651 99300521 908208854 922862249 934908176 942743269 944533396 960738196 965737420 70449273 153849854 272974989 411149518 597026615 826426654 1000000000 1000000000 956070845 711435863 494663293 335470813 212269294 111635214 34262569
output:
14
result:
ok single line: '14'
Test #24:
score: 0
Accepted
time: 0ms
memory: 36480kb
input:
13 999999998 428180064 453825926 496177951 542265409 564354140 623999424 733991584 735577512 795234730 808832729 820421093 895605891 931423865 571819925 546174077 503822037 457734599 435645856 376000580 266008406 264422493 204765262 191167259 179578899 104394103 68576140
output:
5
result:
ok single line: '5'
Test #25:
score: 0
Accepted
time: 4ms
memory: 40528kb
input:
14 999999998 4515495 9904992 25475620 73563324 76637608 86769631 94216071 907247859 931656410 933666727 984350334 984974543 987268027 993426086 4515493 32083815 92928361 222018214 403518475 699592247 107133306 549366014 854705483 546489353 311231200 133429435 54720779 15604910
output:
12
result:
ok single line: '12'
Test #26:
score: 0
Accepted
time: 0ms
memory: 42528kb
input:
14 999999998 11313319 26979744 49935337 85404750 170975560 260885711 426294698 455696159 526506498 589306257 589663449 591771082 689721576 725376405 11313326 26979742 49935327 85404740 170975561 260885705 426294707 455696158 526506507 589306249 589663447 591771088 689721566 725376399
output:
7
result:
ok single line: '7'
Test #27:
score: 0
Accepted
time: 1ms
memory: 26156kb
input:
8 999999998 37723100 54496083 61229468 86267478 933661726 941061931 942456383 967540455 102642189 309948600 543550277 823723776 671118026 423382750 197908898 32459535
output:
7
result:
ok single line: '7'
Test #28:
score: 0
Accepted
time: 1ms
memory: 28276kb
input:
9 999999998 72636384 114113215 283235927 352065895 428412245 467023512 617585180 670550999 744184217 72636393 114113205 283235920 352065894 428412238 467023515 617585183 670550991 744184224
output:
4
result:
ok single line: '4'
Test #29:
score: 0
Accepted
time: 1ms
memory: 44684kb
input:
15 750000000 67849176 127883989 155065871 238001302 268263321 338797295 349803926 413688883 508345422 512345713 525681461 579549983 620335922 691434787 712230646 284918450 461047175 730144198 890540293 327480147 458250023 860792497 713796452 937154500 888159898 595960243 719523848 751461081 71933108...
output:
15
result:
ok single line: '15'
Test #30:
score: 0
Accepted
time: 0ms
memory: 44608kb
input:
15 1000000000 74228911 77263645 191730809 210720482 227897818 238710820 309590716 309987587 418571300 604252987 609022749 671850901 672628347 677322052 995213366 738778850 901756738 890749623 697851638 797959781 799410529 712105420 584272347 942330916 734598992 609756629 719271748 668479825 72328357...
output:
13
result:
ok single line: '13'
Test #31:
score: 0
Accepted
time: 1ms
memory: 40580kb
input:
14 895598008 66542840 99386933 110912372 219124550 312351782 414412857 640116276 686443224 739820207 778350188 782973215 800288780 816382833 837042060 42039832 39815432 76646262 209976603 60083683 325225551 194273248 36132227 96829464 5309136 94973134 80925626 57197891 35032333
output:
0
result:
ok single line: '0'
Test #32:
score: 0
Accepted
time: 3ms
memory: 38524kb
input:
13 999448786 9338040 37102715 150633853 231157464 282664177 315376219 316161980 551670190 623185571 869045820 901788332 970042192 980534405 3370325 8304384 35281948 199742422 241568836 302830252 6537739 280099730 314165160 87616629 7444573 6147628 14398310
output:
0
result:
ok single line: '0'
Test #33:
score: 0
Accepted
time: 1ms
memory: 44636kb
input:
15 10000 1 2 3 4 5 6 7 2000 8000 9994 9995 9996 9997 9998 9999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 3999 3999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
14
result:
ok single line: '14'
Test #34:
score: 0
Accepted
time: 1ms
memory: 42572kb
input:
15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 100 100 100 100 100 100 100 100 100 6 100 100 100 5
output:
14
result:
ok single line: '14'
Test #35:
score: 0
Accepted
time: 1ms
memory: 44588kb
input:
15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 100 100 100 5 100 100 100 100 100 6 100 100 100 5
output:
13
result:
ok single line: '13'
Subtask #3:
score: 10
Accepted
Dependency #1:
100%
Accepted
Test #36:
score: 10
Accepted
time: 57ms
memory: 464408kb
input:
179 183 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
89
result:
ok single line: '89'
Test #37:
score: 0
Accepted
time: 31ms
memory: 362072kb
input:
139 170 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 29 30 31 32 33 35 36 37 38 39 40 42 45 46 48 49 50 52 53 54 55 56 58 60 61 62 64 65 66 67 68 70 71 72 74 76 79 80 82 83 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 103 104 107 109 110 111 112 113 114 115 116 117 119...
output:
88
result:
ok single line: '88'
Test #38:
score: 0
Accepted
time: 12ms
memory: 264008kb
input:
101 183 1 2 3 4 6 7 8 9 10 15 18 20 22 28 29 30 31 32 34 35 38 39 40 41 42 43 45 46 51 52 55 56 60 62 63 65 66 67 68 73 76 78 79 81 82 83 84 85 86 87 88 89 91 92 96 97 99 107 108 112 113 116 117 118 124 125 126 128 130 131 132 136 137 138 139 140 141 144 145 146 147 149 150 151 152 158 159 162 163 1...
output:
59
result:
ok single line: '59'
Test #39:
score: 0
Accepted
time: 34ms
memory: 351852kb
input:
135 176 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 20 21 22 23 25 26 27 30 31 32 34 35 37 38 39 40 41 42 43 44 46 47 48 50 51 52 53 54 55 56 57 58 59 61 62 63 65 66 68 69 71 72 73 74 75 76 78 80 81 82 83 84 85 86 87 88 90 91 92 93 95 97 99 101 102 103 104 105 106 108 110 111 112 114 116 117 121 122 1...
output:
80
result:
ok single line: '80'
Test #40:
score: 0
Accepted
time: 36ms
memory: 399804kb
input:
154 188 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 20 21 23 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 52 53 54 58 60 61 62 63 64 65 66 67 68 69 70 72 74 75 76 77 78 80 81 82 83 84 85 88 89 90 91 92 94 95 97 98 99 100 101 102 103 104 105 107 108 109 110 111 112 113 114 116 117 ...
output:
97
result:
ok single line: '97'
Test #41:
score: 0
Accepted
time: 12ms
memory: 245284kb
input:
93 198 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ...
output:
91
result:
ok single line: '91'
Test #42:
score: 0
Accepted
time: 11ms
memory: 216656kb
input:
82 198 109 110 112 113 114 115 117 118 119 120 121 122 123 124 125 126 127 128 129 130 132 133 134 135 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 181 182 183 184 185 186 1...
output:
40
result:
ok single line: '40'
Test #43:
score: 0
Accepted
time: 7ms
memory: 239428kb
input:
92 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 181 182 183 184 185 186 187 188 189 190 191 192 ...
output:
91
result:
ok single line: '91'
Test #44:
score: 0
Accepted
time: 3ms
memory: 151124kb
input:
56 198 75 76 77 80 84 85 86 89 90 92 94 99 102 108 109 110 113 115 117 119 120 123 124 128 130 131 134 136 138 145 147 149 151 152 160 162 163 165 166 167 168 169 173 174 179 180 181 182 183 185 186 189 192 194 195 197 132 121 126 108 108 112 109 99 110 105 96 106 92 91 98 97 80 84 82 81 82 76 78 76...
output:
30
result:
ok single line: '30'
Test #45:
score: 0
Accepted
time: 12ms
memory: 245756kb
input:
94 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 178 179 180 181 182 183 184 185 186 187 188 189 190 1...
output:
93
result:
ok single line: '93'
Test #46:
score: 0
Accepted
time: 8ms
memory: 208520kb
input:
79 198 1 2 3 4 6 8 9 10 11 13 14 15 16 17 18 19 20 21 22 24 25 27 28 29 31 32 33 34 35 39 40 41 42 44 45 46 47 49 50 52 53 54 55 56 58 59 60 61 63 64 65 68 69 70 71 72 73 76 77 78 79 80 81 82 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 3 4 0 10 12 8 16 7 2 8 11 17 8 12 22 22 19 29 31 19 16 31 25 29...
output:
44
result:
ok single line: '44'
Test #47:
score: 0
Accepted
time: 27ms
memory: 249560kb
input:
95 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 150 151 152 153 154 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 19...
output:
64
result:
ok single line: '64'
Test #48:
score: 0
Accepted
time: 8ms
memory: 219120kb
input:
84 198 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 127 128 129 130 131 132 133 134 135 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 1...
output:
42
result:
ok single line: '42'
Test #49:
score: 0
Accepted
time: 7ms
memory: 239664kb
input:
92 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 189 190 191 192 ...
output:
61
result:
ok single line: '61'
Test #50:
score: 0
Accepted
time: 8ms
memory: 175720kb
input:
66 198 25 26 29 31 34 35 37 39 40 42 44 48 55 60 63 65 66 68 71 74 75 76 80 83 84 86 87 88 89 97 99 100 102 103 104 105 114 116 117 119 122 124 125 127 128 129 131 134 135 141 143 149 152 172 173 174 176 184 185 187 189 190 193 195 196 197 170 168 168 162 172 159 155 152 157 165 149 141 142 130 131 ...
output:
32
result:
ok single line: '32'
Test #51:
score: 0
Accepted
time: 15ms
memory: 241728kb
input:
92 198 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 151 152 153 154 155 156 157 158 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192...
output:
62
result:
ok single line: '62'
Test #52:
score: 0
Accepted
time: 9ms
memory: 142976kb
input:
54 198 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 169 170 171 172 173 174 176 177 178 179 180 181 182 183 184 185 186 187 188 189 191 192 194 195 196 68 48 62 53 57 57 59 47 51 53 48 57 50 38 40 42 51 46 37 44 41 44 34 26 43 38...
output:
34
result:
ok single line: '34'
Test #53:
score: 0
Accepted
time: 7ms
memory: 239144kb
input:
91 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 ...
output:
17
result:
ok single line: '17'
Test #54:
score: 0
Accepted
time: 1ms
memory: 163860kb
input:
62 198 131 132 133 134 135 136 137 138 139 140 141 142 143 144 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 197 71 64 66 72 66 57 60 62 61 52 67 46 55 45 43 ...
output:
34
result:
ok single line: '34'
Test #55:
score: 0
Accepted
time: 24ms
memory: 245884kb
input:
94 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 1...
output:
19
result:
ok single line: '19'
Test #56:
score: 0
Accepted
time: 1ms
memory: 182260kb
input:
69 198 3 5 6 9 12 16 18 22 23 28 29 32 35 40 41 43 46 47 48 50 56 57 58 66 67 71 72 77 78 79 80 95 96 97 102 107 109 111 115 119 121 122 124 125 130 137 138 139 140 143 148 153 154 157 160 162 164 165 169 170 175 179 181 186 187 190 191 192 193 3 3 11 2 4 18 8 18 24 38 28 30 27 45 46 35 41 42 46 41 ...
output:
36
result:
ok single line: '36'
Test #57:
score: 0
Accepted
time: 21ms
memory: 251728kb
input:
96 198 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 18...
output:
20
result:
ok single line: '20'
Test #58:
score: 0
Accepted
time: 8ms
memory: 192088kb
input:
73 198 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 147 148 149 150 151 152 153 154 155 156 157 159 160 161 162 163 164 165 166 167 169 170 171 172 173 175 176 177 178 179 180 181 182 183 184 185 186 187 189 190 191 192 193 194 195 196 197 8...
output:
35
result:
ok single line: '35'
Test #59:
score: 0
Accepted
time: 72ms
memory: 515672kb
input:
199 200 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
153
result:
ok single line: '153'
Test #60:
score: 0
Accepted
time: 32ms
memory: 422116kb
input:
163 173 1 2 3 4 5 6 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 78 79 80 81 82 83 84 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 1...
output:
0
result:
ok single line: '0'
Test #61:
score: 0
Accepted
time: 76ms
memory: 516556kb
input:
199 200 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
155
result:
ok single line: '155'
Test #62:
score: 0
Accepted
time: 40ms
memory: 421484kb
input:
162 192 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 54 55 56 57 58 59 61 63 64 65 66 67 68 69 70 71 72 73 75 76 78 82 84 86 87 88 90 91 92 95 96 97 98 99 100 101 102 103 104 106 107 108 110 111 112 113 114 ...
output:
0
result:
ok single line: '0'
Test #63:
score: 0
Accepted
time: 68ms
memory: 515672kb
input:
199 200 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
156
result:
ok single line: '156'
Test #64:
score: 0
Accepted
time: 47ms
memory: 424596kb
input:
163 175 1 2 3 4 5 7 8 9 10 11 12 13 15 16 17 18 19 20 21 22 24 25 26 27 28 29 30 31 32 33 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 99 100 101 102 103 104 105 106...
output:
0
result:
ok single line: '0'
Subtask #4:
score: 75
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #65:
score: 75
Accepted
time: 64ms
memory: 490188kb
input:
189 954475639 243085 310998 11921383 13742422 16300680 22361420 23319191 28592732 33231170 34697519 39821880 55334501 58954023 61231296 66503001 66579576 76770907 77957641 81208057 88789490 95141797 95192676 100903383 103362982 107958509 119675846 123334988 123887197 130333293 131103658 133521226 13...
output:
108
result:
ok single line: '108'
Test #66:
score: 0
Accepted
time: 69ms
memory: 468536kb
input:
181 931900188 7311154 8374805 16354840 19443968 26003067 27542399 29302255 33537086 35801031 37564100 40701078 41682551 41829794 46770050 47178565 48665264 53713037 62572165 70452286 72706511 74454505 75425010 77613051 83043288 84063279 93529871 99469294 101408277 104328794 116358092 121081200 12359...
output:
108
result:
ok single line: '108'
Test #67:
score: 0
Accepted
time: 55ms
memory: 459364kb
input:
177 989847970 3410479 4308509 18779364 19410423 19692974 22202524 29669655 41131325 42275373 54779552 61763391 62566389 72076150 79629021 86829968 97563397 113385532 114998811 118017704 119447071 131352092 135690581 136938900 145834072 146864954 150117901 151236039 152165059 152566224 167494743 1698...
output:
98
result:
ok single line: '98'
Test #68:
score: 0
Accepted
time: 56ms
memory: 441892kb
input:
170 960126541 1377774 6891580 7976516 12887261 22508629 31614240 36034429 36533678 50401873 75366644 80518111 95477764 115304033 118995231 119865551 122062261 125728898 131016059 132054346 146333358 151362418 153908461 161956860 163576931 166912524 167772641 169139987 175230032 179402340 187431714 1...
output:
88
result:
ok single line: '88'
Test #69:
score: 0
Accepted
time: 75ms
memory: 485692kb
input:
188 844323101 6349019 8241809 8374839 17679365 20128420 35895796 43506521 50296767 53578841 56832687 62658986 63748136 69844201 97102857 102776041 108739753 111794884 119674333 119857645 120199744 122141919 124725367 127703412 129742408 141295479 144177126 145135280 146063603 149022751 153849924 157...
output:
118
result:
ok single line: '118'
Test #70:
score: 0
Accepted
time: 69ms
memory: 476764kb
input:
184 999999998 304385 879345 1565270 1732367 2827691 2895047 3664081 4084523 7793199 8066562 8215186 9718850 10711694 12385027 17598332 19619952 19791937 21822410 23131502 23254627 26418124 28575571 29376537 33008926 33667525 34547307 35436042 35550123 37239402 37774093 40577488 41805362 42683233 436...
output:
183
result:
ok single line: '183'
Test #71:
score: 0
Accepted
time: 82ms
memory: 479384kb
input:
185 999999998 331669391 340895819 353169729 357076688 357585675 359631280 361758966 376759602 377739030 377780451 380580662 381832332 385383362 386885104 389260280 390156418 395129491 414113209 415401559 415825175 417384469 425872791 427089250 428182159 428957138 434905076 440168914 440332590 441177...
output:
98
result:
ok single line: '98'
Test #72:
score: 0
Accepted
time: 59ms
memory: 482920kb
input:
186 999999998 62738 2364388 4137050 8484555 8805419 10456036 10658098 10805834 11976322 12368397 12521313 13527827 15875989 16039859 16454124 17058914 17350695 18535556 19772802 20290246 22928101 29817589 29911658 29929777 30043844 30549443 32575211 33414571 35425627 36456895 36484113 36606533 38029...
output:
185
result:
ok single line: '185'
Test #73:
score: 0
Accepted
time: 52ms
memory: 464516kb
input:
179 999999998 1872639 8489938 8577852 8944208 16479094 19350000 24931160 30228567 30828448 31081372 31820859 32007418 32170832 32634787 33825978 38254633 39006134 39184177 40023104 44466223 48666190 52369736 54290063 55679548 55782605 61099560 61732431 62324374 68876772 76168472 76662088 80181118 80...
output:
89
result:
ok single line: '89'
Test #74:
score: 0
Accepted
time: 53ms
memory: 450132kb
input:
173 999999998 110367 1558244 1704017 3668685 4288864 4313787 6049235 6475015 7500846 10046443 11998099 12192890 12259914 13555360 14557108 14927290 15998614 16265978 16828529 17767077 19409541 23523395 23712516 25444719 25539451 26617327 26903165 27120749 27500475 28448018 30549757 31179234 32128722...
output:
172
result:
ok single line: '172'
Test #75:
score: 0
Accepted
time: 64ms
memory: 470744kb
input:
182 999999998 271756452 291602282 302359123 309923384 314511791 316208647 318232280 320763409 324797756 325889131 326640718 327246674 327520847 327742878 331167149 334844102 343636215 346051749 347001012 347853502 359087299 376820732 382001589 386483729 386490649 390142788 394793995 405750205 406923...
output:
94
result:
ok single line: '94'
Test #76:
score: 0
Accepted
time: 75ms
memory: 505392kb
input:
195 999999998 694561 725128 2292945 2682180 2869347 2983067 4078089 5188443 6741928 7209576 7241128 9034166 9205876 9230164 9911320 13382499 13974408 14162896 15218971 15487357 15635346 16976437 18106782 20247395 20911624 21809745 24429321 24804741 24856744 24873388 27595360 27813858 28794761 291592...
output:
164
result:
ok single line: '164'
Test #77:
score: 0
Accepted
time: 68ms
memory: 506524kb
input:
195 999999998 256501547 257835771 273459117 277389228 284096879 284910051 285443801 285523658 286333669 289748312 290815303 292276350 292586209 292780012 299143469 303280283 313801087 318319529 320806137 321082992 325529971 328357744 330177653 330704682 355181228 358552133 372163835 373596091 375665...
output:
90
result:
ok single line: '90'
Test #78:
score: 0
Accepted
time: 57ms
memory: 442492kb
input:
171 999999998 808438 927159 1653260 2188155 4755017 7954861 11515523 11931803 13978674 14276138 14581979 15809239 17395773 18302653 19710334 22438723 22685243 23094638 23915597 24000596 25009448 25042029 26172749 29484758 29543515 32719520 34138545 34514718 34889507 35277600 35656191 37458006 377759...
output:
144
result:
ok single line: '144'
Test #79:
score: 0
Accepted
time: 49ms
memory: 452144kb
input:
174 999999998 17326486 21455231 32886032 33533958 37049241 43392165 43461328 43809427 43954285 47026903 49846933 51060186 54310185 56905780 62559365 81198709 82566989 90282454 91206082 92305506 100767173 105161476 107781442 113707261 114365264 122991907 140262103 145629513 150485250 151471666 158350...
output:
100
result:
ok single line: '100'
Test #80:
score: 0
Accepted
time: 89ms
memory: 499900kb
input:
193 999999998 4053434 4180587 4191131 4403787 6933947 7209478 7606086 9019735 10043707 10774168 11538104 12633301 12714386 15343388 15971474 16161291 16473855 17100077 17604944 17932738 18008805 19811034 19832055 20145915 21647925 21874672 22198288 24898341 25461141 26191016 26663183 27370411 276204...
output:
168
result:
ok single line: '168'
Test #81:
score: 0
Accepted
time: 36ms
memory: 454232kb
input:
175 999999998 292542019 293510612 296328039 299837910 306031879 308388649 311058543 312399582 314123242 316147674 316785539 324455959 329087849 330941170 334894348 337830018 342640180 344480111 352077367 367464183 370016842 370451068 371141852 372588547 373579218 378381189 381235259 385453492 392049...
output:
92
result:
ok single line: '92'
Test #82:
score: 0
Accepted
time: 41ms
memory: 467040kb
input:
180 999999998 201458 375588 875049 1236709 1537534 6675512 6786801 8279364 10499865 12154340 12652778 16876802 21478230 21676718 22560778 23721130 26025045 27783820 28697192 29584973 29778384 30041539 30871501 30974183 31896425 33237031 33424534 34158310 34165151 35553477 35876750 36715973 37586905 ...
output:
59
result:
ok single line: '59'
Test #83:
score: 0
Accepted
time: 77ms
memory: 516732kb
input:
199 999999998 171192789 171359416 174271737 175475059 176676163 183766476 193085539 194458360 200252636 209700486 214246326 215256251 217163645 220252440 231100371 231778773 232030301 233761296 244033396 256249583 258140523 258804104 274616556 277758902 287469318 292035396 305291507 317504411 323219...
output:
84
result:
ok single line: '84'
Test #84:
score: 0
Accepted
time: 61ms
memory: 475240kb
input:
184 999999998 278791 316484 3181747 5446532 6212129 7706042 8379225 8526324 9432648 12176849 13243839 15723357 16144560 16744793 16914056 18428003 18487547 18573604 19135962 19175855 20161438 21023524 23119839 24496884 26816205 28944639 31077675 31782545 32795894 34319048 34787444 35592291 36589087 ...
output:
66
result:
ok single line: '66'
Test #85:
score: 0
Accepted
time: 60ms
memory: 497384kb
input:
192 999999998 2343970 2798836 5346957 5654613 11267992 11315843 12730845 12735271 12782618 14940090 17406548 17598412 18645582 19180600 20300204 20409394 20680245 23873815 26725585 27109005 27946369 29396584 32509243 32868432 32933758 33122190 34060707 34436507 35859170 37033277 38506677 38560035 41...
output:
115
result:
ok single line: '115'
Test #86:
score: 0
Accepted
time: 63ms
memory: 491188kb
input:
190 999999998 309389 1474411 5731030 6557397 7963195 8150355 9416158 10351397 10530828 11857827 16865661 17145478 17230596 17557222 17557409 17749936 18956301 21255496 22054780 23416905 24310511 24873249 24976826 26082102 27838668 28419629 29404480 30320791 30370941 30571755 31175464 31719416 319096...
output:
68
result:
ok single line: '68'
Test #87:
score: 0
Accepted
time: 69ms
memory: 471800kb
input:
182 999999998 6025401 19476500 22065484 27631361 28972192 31800075 37390980 41029165 41778843 58647961 59855198 66621344 71320496 84116810 90669460 93717222 96605667 96963886 127425536 132035637 135924602 136437733 143018354 150900372 161143775 161358029 166111586 169306454 172311465 176922967 17966...
output:
100
result:
ok single line: '100'
Test #88:
score: 0
Accepted
time: 95ms
memory: 516128kb
input:
200 750000000 1378583 1417981 4215697 13765847 17685258 20379233 26657536 31025465 31892964 32423279 33492234 36988139 37624238 55087249 69877272 80722927 80871839 84477222 87114222 90887296 92472832 94516773 99670724 100052512 101092880 105206987 106086245 108640088 111487287 114042246 121030435 12...
output:
200
result:
ok single line: '200'
Test #89:
score: 0
Accepted
time: 79ms
memory: 518128kb
input:
200 1000000000 273588 5129304 6605593 7975833 8427992 24915887 36827714 37546545 45739339 51263375 57875314 64985049 65147506 66783482 68768804 69042322 71643430 73649897 76159463 80474751 95509267 96690999 105231933 105537458 106128131 107565100 116111124 122231189 126881398 134280330 137284385 149...
output:
157
result:
ok single line: '157'
Test #90:
score: 0
Accepted
time: 56ms
memory: 473304kb
input:
183 750780922 3506789 15470723 15964774 29738715 30061531 32261832 33044857 35687988 43871797 67761233 69741574 81790905 82467250 89156895 99413327 101908013 105124266 111412981 118036530 126633865 134654391 135209322 140276063 142962523 144014576 149180339 151367190 162349721 174970531 179499438 18...
output:
0
result:
ok single line: '0'
Test #91:
score: 0
Accepted
time: 81ms
memory: 519768kb
input:
200 750000000 15709150 21065175 25995627 28374597 29037293 29832856 29934772 33000578 34363082 41120891 42067061 42895465 48969595 63414926 63590707 69230765 77043010 79881785 82013899 86270464 86797931 90134428 92458706 92905384 94470249 101538518 101962462 102824724 107158463 113391144 114902292 1...
output:
200
result:
ok single line: '200'
Test #92:
score: 0
Accepted
time: 77ms
memory: 519716kb
input:
200 1000000000 1297477 4833546 11291765 17611783 17671217 17854117 23672768 23679404 27085597 33755749 37641363 46757226 50982280 64643792 66550766 70715047 73054792 74409357 78073085 83954171 84187268 87618797 92585737 94311443 96335893 112420132 117125153 126458609 131623953 138353224 138803419 14...
output:
149
result:
ok single line: '149'
Test #93:
score: 0
Accepted
time: 72ms
memory: 513576kb
input:
198 871295773 159519 3515028 4966566 11679572 15348290 16468760 36246582 39831579 39944184 41555363 42878474 45489989 48781195 72374376 74257870 95609637 103513302 104166844 105394303 121607543 123537381 132887585 138436189 142601227 145295801 150026412 152451057 162024652 167469514 168839774 174312...
output:
0
result:
ok single line: '0'
Extra Test:
score: 0
Extra Test Passed