QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#462738 | #138. Bali Sculptures | fryan | 71 | 231ms | 34988kb | C++20 | 1.8kb | 2024-07-04 01:45:13 | 2024-07-04 01:45:14 |
Judging History
answer
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define int long long
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()
const int mxn = 2001;
int n,a,b,y[mxn];
const int lg = 50;
bool is_submask(int s, int m) {
for (int i=0; i<63; i++) {
if ((1ll<<i)&s) {
if (((1ll<<i)&m) == 0) return 0;
}
}
return 1;
}
const int inf = 1e9;
int mask = (1ll<<(lg+1))-1;
int dp[mxn];
void proc(int bt) {
mask -= (1ll<<bt);
for (int i=0; i<mxn; i++) {dp[i]=inf;}
dp[0] = 0;
for (int i=0; i<n; i++) {
int csu = 0;
for (int j=i+1; j<=n; j++) {
csu += y[j];
if (is_submask(csu,mask)) {
dp[j] = min(dp[j],dp[i]+1);
}
}
}
if (dp[n] > b) {
mask += (1ll<<bt);
}
}
int dp1[mxn][mxn];
void proc1(int bt) {
mask -= (1ll<<bt);
for (int i=0; i<mxn; i++) {
for (int j=0; j<mxn; j++) {
dp1[i][j]=0;
}
}
dp1[0][0] = 1;
for (int i=0; i<n; i++) {
for (int j=0; j<=n; j++) {
int csu=0;
if (!dp1[i][j]) continue;
for (int k=i+1; k<=n; k++) {
csu += y[k];
if (is_submask(csu,mask)) {
dp1[k][j+1] = 1;
}
}
}
}
for (int i=a; i<=b; i++) {
if (dp1[n][i]) return;
}
mask += (1ll<<bt);
}
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin>>n>>a>>b;
for (int i=1; i<=n; i++) {
cin>>y[i];
}
for (int i=lg; i >= 0; i--) {
if (a==1) proc(i);
else proc1(i);
}
cout << mask;
return 0;
}
详细
Subtask #1:
score: 0
Accepted
Test #1:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
8 1 4 1 2 1 1 1 0 4 6
output:
6
result:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
20 1 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
200
result:
ok single line: '200'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
20 1 3 8 1 1 1 8 2 2 4 2 8 8 1 4 1 1 4 2 4 2 8
output:
27
result:
ok single line: '27'
Test #4:
score: 0
Accepted
time: 1ms
memory: 5672kb
input:
20 1 17 4 2 4 1 8 8 4 1 4 2 2 1 1 2 1 8 1 8 1 2
output:
11
result:
ok single line: '11'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
1 1 1 0
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
5 1 3 3 4 8 8 6
output:
15
result:
ok single line: '15'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
10 1 1 9 7 3 3 7 9 0 9 1 4
output:
52
result:
ok single line: '52'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
15 1 15 0 7 4 1 3 1 0 5 4 3 9 1 3 1 3
output:
11
result:
ok single line: '11'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
17 1 3 10 5 7 3 5 9 0 10 10 7 6 3 3 0 6 8 8
output:
47
result:
ok single line: '47'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
20 1 3 3 0 9 7 1 2 6 0 0 2 1 8 5 5 3 2 9 8 7 9
output:
43
result:
ok single line: '43'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
20 1 3 9 9 8 8 10 8 8 8 8 9 9 8 8 8 9 8 10 8 9 8
output:
62
result:
ok single line: '62'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
20 1 3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
94
result:
ok single line: '94'
Subtask #2:
score: 0
Accepted
Test #13:
score: 0
Accepted
time: 57ms
memory: 34860kb
input:
6 2 3 1 1 1 1 1 1
output:
2
result:
ok single line: '2'
Test #14:
score: 0
Accepted
time: 58ms
memory: 34984kb
input:
20 4 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
30
result:
ok single line: '30'
Test #15:
score: 0
Accepted
time: 57ms
memory: 34916kb
input:
20 2 2 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
100
result:
ok single line: '100'
Test #16:
score: 0
Accepted
time: 58ms
memory: 34988kb
input:
20 2 7 1 4 8 1 4 4 1 1 2 8 2 2 4 1 1 1 8 2 2 4
output:
13
result:
ok single line: '13'
Test #17:
score: 0
Accepted
time: 54ms
memory: 34924kb
input:
20 5 13 1 4 8 1 2 8 1 1 8 8 8 4 4 2 2 1 2 4 8 1
output:
15
result:
ok single line: '15'
Test #18:
score: 0
Accepted
time: 55ms
memory: 34916kb
input:
6 6 6 0 0 0 1 1 2
output:
3
result:
ok single line: '3'
Test #19:
score: 0
Accepted
time: 58ms
memory: 34832kb
input:
6 3 6 6 5 0 0 0 1
output:
7
result:
ok single line: '7'
Test #20:
score: 0
Accepted
time: 53ms
memory: 34924kb
input:
5 2 3 7 5 6 9 8
output:
15
result:
ok single line: '15'
Test #21:
score: 0
Accepted
time: 56ms
memory: 34912kb
input:
10 2 4 9 6 6 9 6 1 3 2 5 2
output:
15
result:
ok single line: '15'
Test #22:
score: 0
Accepted
time: 54ms
memory: 34912kb
input:
15 15 15 4 9 8 4 5 7 1 5 3 7 10 5 4 2 4
output:
15
result:
ok single line: '15'
Test #23:
score: 0
Accepted
time: 57ms
memory: 34840kb
input:
17 3 3 3 6 7 9 9 5 7 5 6 2 6 2 10 8 7 9 7
output:
43
result:
ok single line: '43'
Test #24:
score: 0
Accepted
time: 60ms
memory: 34864kb
input:
20 4 7 9 8 7 2 10 1 3 2 5 0 10 3 6 5 2 3 10 1 3 5
output:
19
result:
ok single line: '19'
Test #25:
score: 0
Accepted
time: 57ms
memory: 34892kb
input:
20 4 7 10 10 8 10 9 10 10 8 10 9 9 8 10 8 8 10 10 9 8 9
output:
31
result:
ok single line: '31'
Subtask #3:
score: 0
Accepted
Test #26:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
5 1 3 451631570 250518388 397580948 477427142 699144811
output:
1040187263
result:
ok single line: '1040187263'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
20 1 20 262144 512 33554432 256 16384 32 8388608 2097152 536870912 524288 64 1024 32768 134217728 67108864 2048 4096 128 268435456 1048576
output:
1052565472
result:
ok single line: '1052565472'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
10 1 4 585497577 747583750 169121856 897466290 878323190 352710279 143784633 220521827 564660939 846262488
output:
1877999615
result:
ok single line: '1877999615'
Test #29:
score: 0
Accepted
time: 1ms
memory: 5620kb
input:
13 1 13 367240258 398331246 114577190 805340028 665732200 504546242 482288665 570430757 818499982 730773252 786783376 500542223 778268439
output:
1073741823
result:
ok single line: '1073741823'
Test #30:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
19 1 3 940393783 972698245 425028628 391884379 863783831 41452681 868278979 777610289 402380933 595956585 956811665 979360137 430377354 468928181 931413765 812044607 856244061 741313322 360289985
output:
5886697470
result:
ok single line: '5886697470'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
20 1 7 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
4000000000
result:
ok single line: '4000000000'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
20 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
20000000000
result:
ok single line: '20000000000'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
20 1 13 1024 512 64 1024 8388608 33554432 64 65536 4194304 4194304 16384 131072 128 65536 524288 4096 16777216 4194304 268435456 512
output:
323704448
result:
ok single line: '323704448'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
20 1 20 2097152 1024 524288 1024 65536 64 4194304 268435456 262144 2097152 1024 536870912 2097152 131072 268435456 512 67108864 64 2097152 536870912
output:
879691328
result:
ok single line: '879691328'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
20 1 3 8388608 33554432 262144 256 16777216 2048 32768 4096 2097152 134217728 67108864 4194304 512 64 268435456 131072 16384 65536 32 524288
output:
535812960
result:
ok single line: '535812960'
Subtask #4:
score: 0
Accepted
Test #36:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
21 1 20 7 2 8 9 5 5 2 8 3 0 5 0 5 9 3 4 1 4 7 7 10
output:
15
result:
ok single line: '15'
Test #37:
score: 0
Accepted
time: 3ms
memory: 3700kb
input:
50 1 10 8 8 6 4 10 8 2 2 5 4 6 3 3 7 2 4 8 1 3 9 9 6 4 4 10 8 1 5 4 10 7 1 6 5 7 5 3 5 9 1 8 4 10 2 10 2 3 1 4 4
output:
31
result:
ok single line: '31'
Test #38:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
25 1 10 4 0 8 2 7 2 6 9 10 3 4 1 4 8 4 4 7 7 10 9 5 0 8 3 10
output:
23
result:
ok single line: '23'
Test #39:
score: 0
Accepted
time: 2ms
memory: 3596kb
input:
38 1 5 4 8 8 4 5 5 3 7 10 6 1 3 10 3 2 9 7 4 7 3 5 5 10 5 0 3 9 7 9 4 7 7 4 10 7 9 5 6
output:
47
result:
ok single line: '47'
Test #40:
score: 0
Accepted
time: 2ms
memory: 3720kb
input:
42 1 18 1 4 4 7 2 9 5 6 0 1 9 5 3 2 8 0 7 9 8 2 5 6 10 0 10 4 0 5 4 2 3 1 0 1 0 4 4 1 7 4 10 7
output:
15
result:
ok single line: '15'
Test #41:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
50 1 20 9 8 8 9 10 10 8 9 8 8 9 10 9 8 10 9 9 10 8 10 8 8 10 9 10 10 9 9 9 10 8 8 9 9 10 9 10 8 9 9 8 9 8 9 10 10 9 9 9 9
output:
27
result:
ok single line: '27'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
50 1 20 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
30
result:
ok single line: '30'
Test #43:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
50 1 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
500
result:
ok single line: '500'
Test #44:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
50 1 20 2 2 6 1 8 4 10 1 2 4 1 3 4 5 5 4 2 5 1 4 8 3 9 8 4 6 5 10 6 6 6 2 4 5 8 3 8 1 1 4 4 10 4 4 6 3 7 3 6 8
output:
15
result:
ok single line: '15'
Test #45:
score: 0
Accepted
time: 4ms
memory: 3664kb
input:
50 1 17 4 10 3 4 2 8 6 6 4 2 8 8 5 4 9 4 10 1 4 6 3 8 3 3 8 3 8 9 8 5 5 2 8 3 8 1 9 9 6 1 10 10 8 7 1 9 8 2 5 9
output:
23
result:
ok single line: '23'
Subtask #5:
score: 0
Accepted
Test #46:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
51 1 20 6 10 12 9 0 3 14 3 0 1 18 20 4 9 7 16 11 15 17 16 10 15 11 1 6 16 19 15 12 17 10 3 6 5 14 6 11 0 18 6 0 2 4 7 7 16 7 9 10 13 0
output:
31
result:
ok single line: '31'
Test #47:
score: 0
Accepted
time: 6ms
memory: 3636kb
input:
65 1 10 4 4 16 20 4 4 1 16 19 7 7 6 7 13 3 17 6 1 18 4 18 11 10 5 6 16 19 12 15 11 1 2 11 9 17 2 3 18 18 4 14 19 6 8 0 16 7 5 17 10 1 12 2 7 17 15 12 13 18 2 12 7 12 8 14
output:
79
result:
ok single line: '79'
Test #48:
score: 0
Accepted
time: 9ms
memory: 3636kb
input:
78 1 23 1 7 6 6 16 19 4 1 3 19 4 11 14 5 11 6 18 15 3 19 1 16 3 11 9 18 4 3 16 5 15 20 19 16 20 15 7 11 4 13 8 5 11 16 5 19 10 0 11 13 16 3 9 13 13 4 9 4 8 18 4 15 15 1 1 2 15 19 9 9 12 14 1 12 10 16 9 1
output:
47
result:
ok single line: '47'
Test #49:
score: 0
Accepted
time: 13ms
memory: 3592kb
input:
91 1 55 17 10 12 19 18 1 10 7 15 15 10 8 1 4 20 1 6 4 11 11 2 3 17 5 20 4 11 6 6 20 1 0 2 5 19 15 9 20 18 1 2 17 14 5 11 14 13 12 11 13 4 16 20 8 13 6 0 7 15 10 15 2 19 17 0 16 17 16 18 2 3 13 12 7 20 6 1 17 6 4 5 19 11 18 5 19 12 17 15 8 11
output:
31
result:
ok single line: '31'
Test #50:
score: 0
Accepted
time: 11ms
memory: 3596kb
input:
100 1 100 14 12 3 1 15 7 6 13 16 16 0 2 12 5 13 6 18 18 3 5 13 14 5 19 12 20 2 1 2 4 13 14 4 13 9 12 4 20 1 10 10 19 10 5 1 7 3 15 9 4 2 9 10 20 15 10 11 13 5 12 2 15 8 1 18 5 7 15 4 11 9 18 20 14 10 8 9 10 18 10 11 0 7 12 6 15 19 0 9 0 15 19 0 2 20 0 9 1 20 17
output:
31
result:
ok single line: '31'
Test #51:
score: 0
Accepted
time: 7ms
memory: 3652kb
input:
100 1 100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20...
output:
20
result:
ok single line: '20'
Test #52:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
100 1 1 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2...
output:
2000
result:
ok single line: '2000'
Test #53:
score: 0
Accepted
time: 15ms
memory: 3660kb
input:
100 1 47 18 1 15 15 2 14 19 16 8 19 1 7 12 5 16 1 5 15 13 15 16 20 8 20 9 13 7 19 8 2 4 4 4 17 5 19 19 16 2 5 13 19 9 19 5 14 17 7 12 13 16 8 7 20 10 20 7 14 19 2 9 8 11 18 19 12 9 13 20 16 10 15 9 16 17 6 20 2 19 20 15 20 8 11 12 4 20 18 1 13 8 1 9 16 12 18 17 1 3 19
output:
47
result:
ok single line: '47'
Test #54:
score: 0
Accepted
time: 16ms
memory: 3660kb
input:
100 1 74 18 7 6 16 5 12 15 13 20 18 20 7 14 19 7 19 19 15 11 16 12 16 1 20 20 12 11 18 17 14 2 9 13 6 2 8 14 11 2 7 14 19 11 20 20 13 18 16 4 10 15 9 17 20 13 15 15 7 7 8 12 20 10 15 15 11 14 19 4 16 1 19 5 17 2 4 7 20 11 1 9 7 4 10 20 19 20 11 20 16 16 11 9 17 3 17 14 12 19 18
output:
31
result:
ok single line: '31'
Subtask #6:
score: 0
Accepted
Test #55:
score: 0
Accepted
time: 8ms
memory: 3580kb
input:
51 1 20 112872931 738945953 683278169 770763749 516510818 790818428 875172481 703986370 60868760 918060338 785761560 775662511 633498896 598270657 590667589 115223551 657182582 662359373 423527461 442741161 404625684 341975402 396747626 126186088 753822361 159840892 743886212 135361223 217348329 815...
output:
1879048191
result:
ok single line: '1879048191'
Test #56:
score: 0
Accepted
time: 19ms
memory: 3568kb
input:
78 1 23 923836836 523842025 628289587 924227079 511267571 346625165 475175021 523287606 3271072 999700331 430350383 323930009 277651833 815950669 597401459 131691797 817247070 850190120 147094539 635552447 96152698 394931183 18786201 365063794 224640001 634087931 406098387 613191072 187802232 111285...
output:
2147352575
result:
ok single line: '2147352575'
Test #57:
score: 0
Accepted
time: 26ms
memory: 3576kb
input:
91 1 55 191959221 117819710 21264154 656591012 279993862 188274213 569336572 16754469 254308293 828635036 133436262 582998229 24339854 543319667 239350173 233498655 970615437 803033323 643769343 574033553 433337176 821491460 181307754 588563382 773726647 999120732 855920243 795015906 870316112 36016...
output:
1073741823
result:
ok single line: '1073741823'
Test #58:
score: 0
Accepted
time: 31ms
memory: 3640kb
input:
100 1 100 897262517 59435838 206381882 362222066 578479976 350662687 580375972 513311419 914695972 558448041 714198210 35193263 88788756 392388113 661818429 619520494 671073907 598522001 349238691 22508880 972902100 818892889 461953972 59786923 741831386 325254397 577331165 510157907 444761786 90036...
output:
1073741823
result:
ok single line: '1073741823'
Test #59:
score: 0
Accepted
time: 6ms
memory: 3700kb
input:
100 1 100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...
output:
1000000000
result:
ok single line: '1000000000'
Test #60:
score: 0
Accepted
time: 6ms
memory: 3632kb
input:
100 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...
output:
100000000000
result:
ok single line: '100000000000'
Test #61:
score: 0
Accepted
time: 25ms
memory: 3592kb
input:
100 1 100 4719616 16400 9744 524296 4204580 34304 2195712 637534212 16385 318767744 41943104 268566784 2107408 65536 33620224 32896 34078724 8388736 132616 17 268566944 268435777 822088256 612368384 403702272 679510528 16777216 2097477 147712 1050624 37765144 5 5898272 16453 806618112 201335296 2684...
output:
1040187359
result:
ok single line: '1040187359'
Test #62:
score: 0
Accepted
time: 24ms
memory: 3652kb
input:
100 1 100 524800 268435472 3153920 528960 128 277872656 262144 269484036 16416 33620496 344195072 4194304 8358 1024 273416212 5242907 1024 4096 262656 69208449 1098756 86016008 285343744 16777216 133120 65540 16843264 33816600 310380048 71434312 138739716 4194313 268575044 33693832 4194304 16777728 ...
output:
1006630911
result:
ok single line: '1006630911'
Subtask #7:
score: 0
Accepted
Test #63:
score: 0
Accepted
time: 231ms
memory: 34840kb
input:
90 45 90 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2
output:
2
result:
ok single line: '2'
Test #64:
score: 0
Accepted
time: 217ms
memory: 34920kb
input:
100 47 74 268439560 67108864 135266304 42074240 8192 654311440 3146005 151136512 25346080 32996 539000832 814809088 589824 9048320 67240448 134218368 331844 2113577 524288 545260544 78208 256 50335808 16793604 536875016 50331688 285212684 274860032 1048576 8192 671105024 262144 41364 805339152 2048 ...
output:
1073676287
result:
ok single line: '1073676287'
Test #65:
score: 0
Accepted
time: 216ms
memory: 34912kb
input:
100 33 66 42500608 541065216 33284 16436 8388616 5376002 268436482 69185 8192 1024 34078720 16777216 264448 269131776 131908 75393 268437512 285278401 8208 33554689 557060 2097184 12591106 134217728 536903698 534784 16777220 256 16777232 423624712 21233664 293634050 136 35651587 663552 134234113 671...
output:
1065352959
result:
ok single line: '1065352959'
Test #66:
score: 0
Accepted
time: 82ms
memory: 34920kb
input:
51 11 20 140150592 3734210 15789782 587667925 232084407 771056473 802447725 807351149 325461838 227735654 492223279 354958716 373810782 666553782 514404606 711298506 863206542 686610915 442109880 823668609 358013640 920121296 306118243 610522093 931738265 472669282 324095528 121814877 760604986 7006...
output:
2080374783
result:
ok single line: '2080374783'
Test #67:
score: 0
Accepted
time: 105ms
memory: 34920kb
input:
65 2 10 396169868 359949875 502267077 450740086 507121397 570144940 23894085 71143618 62920474 102895297 269825202 227951844 706777068 130693744 354410473 880548203 59480734 236985238 293898169 8305051 909907329 558305057 671268876 68669724 976783949 147069678 881735781 940128032 259987387 767336296...
output:
3187671039
result:
ok single line: '3187671039'
Test #68:
score: 0
Accepted
time: 137ms
memory: 34924kb
input:
78 2 23 249890663 783223191 80338675 989476041 452741517 119332314 815744289 832096085 807056767 447208859 943873124 166653816 711179298 899068905 723907090 616980020 574611274 841834853 222559367 672421207 822239943 466913882 990180497 2542747 910439935 238984082 430538469 911475582 354354169 51971...
output:
3187671039
result:
ok single line: '3187671039'
Test #69:
score: 0
Accepted
time: 181ms
memory: 34832kb
input:
91 19 55 199776664 784097501 551979695 849215761 888617731 297981863 230030135 382048933 92483014 111260499 719179517 575225173 963577465 368761993 49577610 731641140 442506781 872881983 679540886 42778343 577941084 784112324 190303846 704666976 803326689 629828194 367910926 376969061 604894999 2556...
output:
2080374783
result:
ok single line: '2080374783'
Test #70:
score: 0
Accepted
time: 217ms
memory: 34904kb
input:
100 57 100 334307059 743986690 394947001 774420772 414996669 819048591 476647461 269780869 374745898 133397578 517410677 385491967 667457113 998436194 972773244 495932276 404452026 975078683 630798486 828348071 21785563 662538552 297332556 424596861 285813802 760543927 983316876 611288856 963039237 ...
output:
1073741823
result:
ok single line: '1073741823'
Test #71:
score: 0
Accepted
time: 154ms
memory: 34844kb
input:
100 57 100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100...
output:
1000000000
result:
ok single line: '1000000000'
Test #72:
score: 0
Accepted
time: 158ms
memory: 34912kb
input:
100 2 2 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...
output:
50000000000
result:
ok single line: '50000000000'
Test #73:
score: 0
Accepted
time: 209ms
memory: 34984kb
input:
100 2 100 539042816 312475648 51904512 8200 32768 67109376 655361 8192 810027008 270799872 268570628 64 574620802 289406976 16978240 4 268440584 1 278528 310394880 268442248 271584256 2113684 268506240 80 136381064 17039888 1152 1 18874372 50 768 8224 536877064 268469633 4608 4672 16777220 4390976 6...
output:
1006632959
result:
ok single line: '1006632959'
Subtask #8:
score: 0
Time Limit Exceeded
Test #74:
score: 0
Accepted
time: 26ms
memory: 3600kb
input:
101 1 20 109288331 167187936 289459547 455669706 656308194 233503022 562258473 2210429 243994669 58628149 750503963 610269250 29072940 251143410 458350486 696874700 870849343 646709707 646709077 746808795 87439926 187779526 762073671 569489420 380238922 982163795 784978520 933220915 264403502 755738...
output:
3221159935
result:
ok single line: '3221159935'
Test #75:
score: -0
Time Limit Exceeded
input:
2000 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
output:
result:
Subtask #9:
score: 9
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Subtask #10:
score: 16
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #4:
100%
Accepted
Subtask #11:
score: 21
Accepted
Dependency #1:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Subtask #12:
score: 25
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Subtask #13:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #8:
0%