QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#446695#6389. Topicalandria0506100 ✓237ms175524kbC++175.3kb2024-06-17 15:16:162024-06-17 15:16:16

Judging History

你现在查看的是最新测评结果

  • [2024-06-17 15:16:16]
  • 评测
  • 测评结果:100
  • 用时:237ms
  • 内存:175524kb
  • [2024-06-17 15:16:16]
  • 提交

answer

/*
¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯_¯_¯¦¦¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯¦¦¦¦¦¦¦_¯_¯_¯_¯_¯_¯¦¦¦¦¦¦¦_¯_¯_¯¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦
¦¦¦_¯_¯_¯_¯_¯_¯_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯_¯_¯¦¦¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯_¯_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯_¯_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦¦¦_¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦_¯¦¦¦¦¦_¯_¯_¯_¯¦¦¦¦¦¦¦_¯¦¦¦¦¦¦_¯_¯_¯¦¦¦¦¦_¯_¯_¯¦¦¦¦¦_¯¦¦¦¦¦¦_¯¦¦¦
¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define int long long
int l[1000005],r,n,t,m,mid,ans,sum[1000005],sum1,sum2,sum0,k,p[1000005];
vector <pair <int,int> > v[1000005];
vector <int> v1;
map <int,int> mp;
string s,s1;
bool b1;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    t=1;
    // cin>>t;
    while(t--){
        cin>>n>>k;
        long long a[n+5][k+5];
        long long b[n+5][k+5];
        for(int i=1;i<=n;i++){
            for(int j=1;j<=k;j++){
                cin>>a[i][j];
                if(a[i][j]==0){
                    sum[i]++;
                    if(sum[i]==k){
                        v1.pb(i);
                    }
                }
                v[j].pb(make_pair(a[i][j],i));
                
            }
        }
        for(int i=1;i<=max(n,k);i++){
            sum[i]=0;
            l[i]=-1;
        }
        for(int i=0;i<v1.size();i++){
            sum[v1[i]]=k;
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=k;j++){
                cin>>b[i][j];
                
            }
        }
        for(int j=1;j<=k;j++){
            sort(v[j].begin(),v[j].end());
        }
        for(int i=0;i<v1.size();i++){
            for(int j=1;j<=k;j++){
                p[j]+=b[v1[i]][j];
                while(l[j]+1<v[j].size()){
                    if(p[j]>=v[j][l[j]+1].ff){
                        
                        l[j]++;
                        sum[v[j][l[j]].ss]++;
                        if(sum[v[j][l[j]].ss]==k){
                            v1.pb(v[j][l[j]].ss);
                        }
                    }else{
                        break;
                    }
                }
            }
        }
        cout<<v1.size()<<endl;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 12
Accepted

Test #1:

score: 12
Accepted
time: 3ms
memory: 32080kb

input:

1 1
693647287
340782526

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 4ms
memory: 32512kb

input:

1 100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
279985824 991797187 998715443 98505529 106002744 636773096 815089164 196160830 796988849 87975...

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 6ms
memory: 33152kb

input:

1 10000
841961872 0 0 0 0 0 0 0 0 0 0 0 0 0 831386430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 205210920 705123207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 276768098 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 661649446 0 0 0 0 0 0 0 0 0 0 ...

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 118ms
memory: 175524kb

input:

1 1000000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 127ms
memory: 175452kb

input:

1 1000000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #6:

score: 0
Accepted
time: 114ms
memory: 175444kb

input:

1 1000000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #7:

score: 0
Accepted
time: 106ms
memory: 169440kb

input:

1 1000000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

0

result:

ok 1 number(s): "0"

Subtask #2:

score: 28
Accepted

Test #8:

score: 28
Accepted
time: 0ms
memory: 32532kb

input:

100 1
893339036
896783899
690308537
201770764
262364362
105000893
770698921
744238454
470980016
935046317
642998516
100481910
392307650
116783134
196939768
372329082
346372520
43063564
245523488
389084350
130314590
412588681
987795927
681635353
304582580
472268968
700147283
743357606
792644412
99955...

output:

85

result:

ok 1 number(s): "85"

Test #9:

score: 0
Accepted
time: 4ms
memory: 32460kb

input:

100 100
1000000000 828788913 1000000000 894501902 1000000000 898513761 837197514 865900986 809812226 853486369 848261509 888902562 1000000000 881898651 932777249 907237990 892103882 1000000000 870206141 1000000000 776016734 1000000000 889438568 856689807 887799348 859324346 872070680 879391131 10000...

output:

52

result:

ok 1 number(s): "52"

Test #10:

score: 0
Accepted
time: 4ms
memory: 32404kb

input:

100 100
41480899 30067130 58529342 49191374 36083890 45869147 82882297 25460110 21315365 52337344 42838103 95288437 42422092 25746530 28684959 32396052 47213835 14999141 84259101 69379196 58772017 10509388 45699641 41109640 62503495 33775884 57523709 1990663 18948036 30586976 29047423 53910876 76929...

output:

96

result:

ok 1 number(s): "96"

Test #11:

score: 0
Accepted
time: 4ms
memory: 31612kb

input:

100 100
289 86731686 104203973 0 103733663 0 357 55630533 201 168 0 907 867 24344425 14132343 648 0 34115723 1510 0 682 0 203 0 0 79 9 551 0 0 1425 96 0 0 1176 45893369 746 0 98201344 45004383 0 0 0 400 0 108 568 0 0 327 595 0 549 0 0 0 0 0 174193885 769 61287071 447 0 521 0 0 614 190 0 0 0 365 468 ...

output:

52

result:

ok 1 number(s): "52"

Test #12:

score: 0
Accepted
time: 4ms
memory: 33500kb

input:

100 100
102824758 349759604 341038688 116603271 303686244 127648700 278523632 309307131 365722578 26901349 99838567 193058542 293422590 242507478 394727765 296396041 317193797 302169141 396984168 176381845 358508382 102152452 140925666 255760562 342867397 313967511 41268403 121370884 190117747 13885...

output:

81

result:

ok 1 number(s): "81"

Test #13:

score: 0
Accepted
time: 7ms
memory: 33436kb

input:

100 100
700358276 767484068 369674679 148136949 620984557 688090307 550280562 602615728 647381987 652824911 625175678 603007596 705242593 15704638 687562897 633557500 634833702 642307730 744014690 620431202 650797129 618657671 666033337 758270575 696322920 672923821 9955917 718437326 37513776 683145...

output:

73

result:

ok 1 number(s): "73"

Test #14:

score: 0
Accepted
time: 4ms
memory: 32768kb

input:

100 100
1000000000 783946496 1000000000 781539493 760136479 740872442 650771124 806997276 708243352 1000000000 657640762 711461735 1000000000 1000000000 771706381 1000000000 781909316 1000000000 1000000000 623846100 1000000000 625316877 1000000000 1000000000 762255119 1000000000 1000000000 774482788...

output:

53

result:

ok 1 number(s): "53"

Subtask #3:

score: 21
Accepted

Test #15:

score: 21
Accepted
time: 0ms
memory: 33348kb

input:

10000 1
568857328
651788426
751475430
102940442
763289419
468657944
770847628
780257867
16919385
575963868
281824241
291248174
140016533
313529232
302186452
32709864
787073783
1926820
239509174
220454071
34252400
390385721
675239026
245106357
489697460
28435096
825528061
159083009
16370561
223299279...

output:

10000

result:

ok 1 number(s): "10000"

Test #16:

score: 0
Accepted
time: 29ms
memory: 43596kb

input:

100000 1
78763439
671847244
661890823
215179284
804182046
667280820
140277780
822235648
809998506
39559747
459311656
212179350
227573276
606854131
182676019
61302123
281509402
53785090
106827674
911115512
31998233
678388767
75425082
154920343
882021740
976962371
219500493
609794633
780392857
6696241...

output:

68284

result:

ok 1 number(s): "68284"

Test #17:

score: 0
Accepted
time: 14ms
memory: 46540kb

input:

100000 1
25138355
17042043
1791957
6455298
6022262
943678542
14813410
711168650
249633996
3186950
16632667
24001382
2843444
25153901
570090758
3077367
2314262
26140773
17228102
497847556
12294116
18909179
422337291
16067561
259209280
289237264
25047202
160449968
12519857
1244368
11282595
29145099
82...

output:

68282

result:

ok 1 number(s): "68282"

Test #18:

score: 0
Accepted
time: 237ms
memory: 169188kb

input:

1000000 1
799588087
822681913
254545397
97351630
427025189
658494837
651864977
636227655
1000000000
421118974
131934476
789087487
271663521
77040834
306682621
23246800
1000000000
4080691
114988214
1000000000
152635014
288639494
200342229
407473872
336259342
490398961
1000000000
21149811
32578493
100...

output:

1000000

result:

ok 1 number(s): "1000000"

Test #19:

score: 0
Accepted
time: 216ms
memory: 168320kb

input:

1000000 1
285376023
139701461
759149436
338563243
968059592
91064260
200562697
294820886
259550266
299285061
322691459
998705676
208944881
841078516
89430704
14548712
108680769
300057128
632999611
730925777
602763167
365431973
31822063
253511251
229737836
323612130
46929299
114782466
120813050
43248...

output:

830576

result:

ok 1 number(s): "830576"

Test #20:

score: 0
Accepted
time: 229ms
memory: 169328kb

input:

1000000 1
799588087
822681913
254545397
97351630
427025189
658494837
651864977
636227655
1000000000
421118974
131934476
789087487
271663521
77040834
306682621
23246800
1000000000
4080691
114988214
1000000000
152635014
288639494
200342229
407473872
336259342
490398961
1000000000
21149811
32578493
100...

output:

1000000

result:

ok 1 number(s): "1000000"

Test #21:

score: 0
Accepted
time: 211ms
memory: 168260kb

input:

1000000 1
285376023
139701461
759149436
338563243
968059592
91064260
200562697
294820886
259550266
299285061
322691459
998705676
208944881
841078516
89430704
14548712
108680769
300057128
632999611
730925777
602763167
365431973
31822063
253511251
229737836
323612130
46929299
114782466
120813050
43248...

output:

830576

result:

ok 1 number(s): "830576"

Subtask #4:

score: 39
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #22:

score: 39
Accepted
time: 179ms
memory: 68616kb

input:

100 10000
758164974 760278955 749320536 807177709 1000000000 791707336 705625552 721176498 830285531 829245614 693737715 1000000000 763639216 791266133 780249438 820066310 1000000000 765831077 827413296 776749555 1000000000 693491280 776532019 788999751 788282686 1000000000 1000000000 1000000000 811...

output:

62

result:

ok 1 number(s): "62"

Test #23:

score: 0
Accepted
time: 179ms
memory: 64408kb

input:

1000 1000
419799954 141926698 389194058 377255536 329668983 276964792 397366890 399677793 326840438 370395311 353138970 377756241 383992391 350779073 174541792 67620133 376548617 303605353 99226283 379229321 693939 48155203 317695757 49565049 400307418 384358053 390972467 410153643 378342083 1531918...

output:

515

result:

ok 1 number(s): "515"

Test #24:

score: 0
Accepted
time: 198ms
memory: 72384kb

input:

100000 10
574423405 579196594 22110263 577761671 579614174 580226186 582613439 579622788 581530431 580226047
250430431 254857770 253790779 254049898 255610340 171318334 258578332 254016339 208718501 254895975
339856624 276238206 176289113 171138262 344656100 346614607 95111741 344040749 244195672 27...

output:

84552

result:

ok 1 number(s): "84552"

Test #25:

score: 0
Accepted
time: 137ms
memory: 67932kb

input:

100 10000
0 0 0 0 0 886 0 853 0 0 0 220 178675447 0 117084192 0 0 0 139 0 175 0 0 0 719 0 0 0 0 0 0 252 0 0 0 0 0 0 3 0 308665976 0 265 235 0 84269463 0 0 0 440 0 0 0 0 0 0 0 0 357305019 0 0 0 0 0 0 0 84 0 0 0 0 656 0 0 0 149 1274 778 0 0 0 0 0 83 0 143 1847 0 0 0 0 6533256 0 0 0 0 0 0 21966594 799 ...

output:

62

result:

ok 1 number(s): "62"

Test #26:

score: 0
Accepted
time: 141ms
memory: 63376kb

input:

1000 1000
264443628 512313245 72082913 790738195 946767541 945413870 32927811 307075648 587732172 67362368 882090696 727763222 793266400 664638108 78393458 621932941 5401624 30759237 577372919 183522703 443988783 321214575 778269021 537062723 913978927 311832369 729084791 833682492 35863428 66855920...

output:

515

result:

ok 1 number(s): "515"

Test #27:

score: 0
Accepted
time: 169ms
memory: 66556kb

input:

10000 100
79618259 90756486 87036067 35300 33227 161318 59235 57653 81045042 90102766 34708 58669 32877 107375 83964194 62754 32379 56004 83857423 87458533 82935963 32137 35972 63677 34873 89995094 63889 86831279 112465 113224 34114 165167 86698263 84587409 33882 62998 36497 91856491 37387 87186130 ...

output:

8869

result:

ok 1 number(s): "8869"

Test #28:

score: 0
Accepted
time: 189ms
memory: 71908kb

input:

100000 10
36537532 36527269 9158389 9096104 9085543 201431370 202656783 9103713 9119961 202513164
36790999 36768031 9221419 9150387 9149251 202766401 203996828 9161882 9179137 203827568
36203336 36184838 9068073 9015881 9005011 199646786 200881956 9022609 9035530 200748689
439979668 249156838 966698...

output:

84549

result:

ok 1 number(s): "84549"

Test #29:

score: 0
Accepted
time: 164ms
memory: 67436kb

input:

10000 100
27 27 999837805 999847161 69 999936942 65 999942838 999926794 999994212 999851197 999956026 999944396 65 999436326 999994460 999982937 999987014 999965876 999966976 999909690 999986533 999934801 82 999936053 999898035 999910898 999886995 999793700 999960521 999996217 999603991 999983962 99...

output:

9023

result:

ok 1 number(s): "9023"

Test #30:

score: 0
Accepted
time: 185ms
memory: 65856kb

input:

10000 100
412339974 627050520 639337793 637132163 636468305 378511809 73703202 524879699 638032666 441486886 640031585 632030998 638580695 292472001 635228328 40072879 646277469 636819077 637640231 401279865 644712282 640669572 78512616 638206043 640481980 638185513 159230492 634533592 640041547 637...

output:

9542

result:

ok 1 number(s): "9542"

Test #31:

score: 0
Accepted
time: 119ms
memory: 75080kb

input:

100000 10
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 1 1 0 0 0 0 0 1 0
0 1 1 0 0 0 1 0 0 0
1 1 1 0 0 0 1 0 1 0
1 0 1 1 0 1 1 0 1 0
1 1 1 1 0 1 0 0 1 0
0 1 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 1 1 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
1 1 1 0 0 ...

output:

96262

result:

ok 1 number(s): "96262"

Extra Test:

score: 0
Extra Test Passed