QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#183426#5375. SearchLynkcat75 1046ms102944kbC++205.1kb2023-09-19 15:04:132023-09-19 15:04:14

Judging History

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

  • [2023-09-19 15:04:14]
  • 评测
  • 测评结果:75
  • 用时:1046ms
  • 内存:102944kb
  • [2023-09-19 15:04:13]
  • 提交

answer

#include <bits/stdc++.h>
#include "search.h"
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
// #define int ll

using namespace std;

namespace query 
{
    const int N=2005;
    int f[N][N];
    int n;
    int t1,t2;
    int bnd[N],pos[N];
    int mx,my;

    mt19937_64 rnd(time(0));
    map<pair<pa,pa>,string>Mp;
    map<pa,string>Mp1;
    string query1(int x,int y,int a,int b)
    {
        if (x<=a&&y<=b) return "<";
        if (Mp.count(mp(mp(x,y),mp(a,b)))) return Mp[mp(mp(x,y),mp(a,b))];
        t1++;
        string res=ask1(x,y,a,b);
        Mp[mp(mp(x,y),mp(a,b))]=res;
        if (res=="<") Mp[mp(mp(a,b),mp(x,y))]=">";
        else Mp[mp(mp(a,b),mp(x,y))]="<";
        return res;
    }
    string query2(int x,int y)
    {
        if (Mp1.count(mp(x,y))) return Mp1[mp(x,y)];
        t2++;
        string res=ask2(x,y);
        Mp1[mp(x,y)]=res;
        return res;
    }
    void geta(int k,int x,int y)
    {
        if (!x) return;
        int l=pos[k]+1,r=bnd[k];
        while (l<=r)
        {
            int mid=l+(r-l)/2;
            mid=l;
            if (query1(mid,k,x,y)=="<")
            {
                pos[k]=mid;
                l=mid+1;
            } else r=mid-1;
        }
    }
    void getb(int k,int x,int y)
    {
        int l=pos[k]+1,r=bnd[k];
        while (l<=r)
        {
            int mid=l+(r-l)/2;
            mid=r;
            if (query1(mid,k,x,y)=="<")
            {
                l=mid+1;
            } else
            {
                bnd[k]=mid-1;
                r=mid-1;
            }
        }
    }
    inline int calc(int x,int y)
    {
        return max((f[x][y]-1),(f[n][n]-f[x-1][n]-f[n][y-1]+f[x-1][y-1]-1));
    }
    int solve()
    {
        bool bl=1;
        for (int i=1;i<=n;i++)
            if (pos[i]==bnd[i]) bl&=1;
            else bl=0;
        int tot=0;
        poly g;
        for (int i=1;i<=n;i++)
        {
            tot+=bnd[i]-pos[i];
            if (bnd[i]!=pos[i]) g.push_back(i);
        }
        if (bl) return 1;
        // cout<<tot<<" "<<::c2<<endl;
        int sm=tot;
        int od=rnd()%sm;
        sm=0;
        int cx=0,cy=0;
        for (int i=1;i<=n;i++)
        {
            for (int j=1;j<=n;j++)
            {
                f[i][j]=0;
            }
        }
        for (int j=1;j<=n;j++)
            for (int i=pos[j]+1;i<=bnd[j];i++) f[i][j]=1;
        for (int i=1;i<=n;i++)
            for (int j=1;j<=n;j++)
                f[i][j]+=f[i-1][j]+f[i][j-1]-f[i-1][j-1];
        int Tot=0;
        vector<pa>all;
        if (t1+tot*(__lg(tot)+1)>128000)
        {
            for (int j=1;j<=n;j++)
                for (int i=pos[j]+1;i<=bnd[j];i++) 
                    if (calc(i,j)*2<=tot) all.push_back(mp(i,j));
            int ooo=rnd()%all.size();
            cx=all[ooo].fi,cy=all[ooo].se;
        } else
        {
            for (int j=1;j<=n;j++)
                for (int i=pos[j]+1;i<=bnd[j];i++) 
                    all.push_back(mp(i,j));
            stable_sort(all.begin(),all.end(),[&](pa x,pa y)
            {
                return query1(x.fi,x.se,y.fi,y.se)=="<";
            });
            int l=0,r=all.size()-1;
            int res=0;
            while (l<=r)
            {
                int mid=l+(r-l)/2;
                if (query2(all[mid].fi,all[mid].se)=="<")
                {
                    res=mid+1;
                    l=mid+1;
                } else r=mid-1;
            }
            for (int i=0;i<res;i++)
                pos[all[i].se]=bnd[all[i].se]=all[i].fi;
            return 1;
        }
        // if (tot>0)
        // {
        //     for (auto u:g)
        //     {
        //         sm+=bnd[u]-pos[u];
        //         if (od<sm)
        //         {
        //             cx=bnd[u]-(sm-od)+1;
        //             cy=u;
        //             break;
        //         }
        //     }
        // }
        if (query2(cx,cy)=="<")
        {
            pos[cy]=cx;
            for (int i=n;i>=1;i--)
                {
                    if (i<n)
                        pos[i]=max(pos[i],pos[i+1]);
                    if (i!=cy)
                        geta(i,cx,cy);
                }
        } else
        {
            bnd[cy]=cx-1;
            for (int i=1;i<=n;i++)
                {
                    if (i>1)
                        bnd[i]=min(bnd[i],bnd[i-1]);
                    if (i!=cy)
                        getb(i,cx,cy);
                }
        }
        return 0;
    }

    int main(int nn) 
    {
        n=nn;
        mx=n,my=n;
        if (query2(n,n)=="<")
        {
            return n*n;
        }
        poly g;
        for (int i=1;i<=n;i++)
            g.push_back(i),bnd[i]=n;
        while (!solve());
        int ans=0;
        for (int i=1;i<=n;i++) ans+=pos[i];
        return ans;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 6204kb

input:

6 3
384 45
837639677

output:

1 143 6

result:

points 1.0 correct, ask1 called 143 time(s), ask2 called 6 time(s)

Test #2:

score: 10
Accepted
time: 0ms
memory: 5948kb

input:

8 59
512 45
439876779

output:

1 298 7

result:

points 1.0 correct, ask1 called 298 time(s), ask2 called 7 time(s)

Test #3:

score: 10
Accepted
time: 0ms
memory: 6320kb

input:

9 27
576 45
777817090

output:

1 396 8

result:

points 1.0 correct, ask1 called 396 time(s), ask2 called 8 time(s)

Test #4:

score: 10
Accepted
time: 1ms
memory: 6252kb

input:

7 14
448 45
42081112

output:

1 191 7

result:

points 1.0 correct, ask1 called 191 time(s), ask2 called 7 time(s)

Test #5:

score: 10
Accepted
time: 1ms
memory: 5956kb

input:

6 14
384 45
380054191

output:

1 145 6

result:

points 1.0 correct, ask1 called 145 time(s), ask2 called 6 time(s)

Test #6:

score: 10
Accepted
time: 1ms
memory: 6012kb

input:

9 13
576 45
718060038

output:

1 401 8

result:

points 1.0 correct, ask1 called 401 time(s), ask2 called 8 time(s)

Test #7:

score: 10
Accepted
time: 2ms
memory: 8088kb

input:

9 16
576 45
1056065885

output:

1 381 7

result:

points 1.0 correct, ask1 called 381 time(s), ask2 called 7 time(s)

Test #8:

score: 10
Accepted
time: 0ms
memory: 6000kb

input:

7 41
448 45
320297139

output:

1 181 7

result:

points 1.0 correct, ask1 called 181 time(s), ask2 called 7 time(s)

Test #9:

score: 10
Accepted
time: 1ms
memory: 5988kb

input:

7 33
448 45
658302986

output:

1 196 7

result:

points 1.0 correct, ask1 called 196 time(s), ask2 called 7 time(s)

Test #10:

score: 10
Accepted
time: 1ms
memory: 5968kb

input:

7 30
448 45
996276065

output:

1 193 6

result:

points 1.0 correct, ask1 called 193 time(s), ask2 called 6 time(s)

Test #11:

score: 10
Accepted
time: 0ms
memory: 5992kb

input:

7 37
448 45
598480398

output:

1 189 7

result:

points 1.0 correct, ask1 called 189 time(s), ask2 called 7 time(s)

Test #12:

score: 10
Accepted
time: 1ms
memory: 6040kb

input:

10 27
640 45
936486245

output:

1 498 7

result:

points 1.0 correct, ask1 called 498 time(s), ask2 called 7 time(s)

Test #13:

score: 10
Accepted
time: 1ms
memory: 6016kb

input:

8 22
512 45
200750268

output:

1 305 7

result:

points 1.0 correct, ask1 called 305 time(s), ask2 called 7 time(s)

Test #14:

score: 10
Accepted
time: 1ms
memory: 6124kb

input:

10 41
640 45
538723346

output:

1 493 8

result:

points 1.0 correct, ask1 called 493 time(s), ask2 called 8 time(s)

Test #15:

score: 10
Accepted
time: 1ms
memory: 6248kb

input:

6 35
384 45
876729193

output:

1 152 6

result:

points 1.0 correct, ask1 called 152 time(s), ask2 called 6 time(s)

Test #16:

score: 10
Accepted
time: 0ms
memory: 6312kb

input:

10 98
640 45
140960448

output:

1 457 8

result:

points 1.0 correct, ask1 called 457 time(s), ask2 called 8 time(s)

Test #17:

score: 10
Accepted
time: 1ms
memory: 5992kb

input:

8 36
512 45
478966295

output:

1 317 7

result:

points 1.0 correct, ask1 called 317 time(s), ask2 called 7 time(s)

Test #18:

score: 10
Accepted
time: 1ms
memory: 5936kb

input:

8 9
512 45
81170628

output:

1 335 7

result:

points 1.0 correct, ask1 called 335 time(s), ask2 called 7 time(s)

Test #19:

score: 10
Accepted
time: 1ms
memory: 5980kb

input:

6 20
384 45
419176475

output:

1 138 6

result:

points 1.0 correct, ask1 called 138 time(s), ask2 called 6 time(s)

Test #20:

score: 10
Accepted
time: 0ms
memory: 5908kb

input:

6 23
384 45
757149553

output:

1 137 7

result:

points 1.0 correct, ask1 called 137 time(s), ask2 called 7 time(s)

Subtask #2:

score: 65
Acceptable Answer

Test #21:

score: 90
Accepted
time: 805ms
memory: 101032kb

input:

1998 997469
511488 45
691176210

output:

1 76427 29

result:

points 1.0 correct, ask1 called 76427 time(s), ask2 called 29 time(s)

Test #22:

score: 90
Accepted
time: 821ms
memory: 101292kb

input:

1997 250682
511232 45
1029182057

output:

1 90561 28

result:

points 1.0 correct, ask1 called 90561 time(s), ask2 called 28 time(s)

Test #23:

score: 90
Accepted
time: 934ms
memory: 101420kb

input:

2000 1742216
512000 45
293413312

output:

1 85871 32

result:

points 1.0 correct, ask1 called 85871 time(s), ask2 called 32 time(s)

Test #24:

score: 90
Accepted
time: 782ms
memory: 101112kb

input:

1996 2394420
510976 45
631419158

output:

1 81924 29

result:

points 1.0 correct, ask1 called 81924 time(s), ask2 called 29 time(s)

Test #25:

score: 90
Accepted
time: 770ms
memory: 100320kb

input:

1998 3398507
511488 45
969425005

output:

1 55032 29

result:

points 1.0 correct, ask1 called 55032 time(s), ask2 called 29 time(s)

Test #26:

score: 90
Accepted
time: 870ms
memory: 100488kb

input:

1998 574252
511488 45
571662106

output:

1 96384 29

result:

points 1.0 correct, ask1 called 96384 time(s), ask2 called 29 time(s)

Test #27:

score: 90
Accepted
time: 721ms
memory: 99680kb

input:

1996 1162097
510976 45
909635185

output:

1 81997 23

result:

points 1.0 correct, ask1 called 81997 time(s), ask2 called 23 time(s)

Test #28:

score: 90
Accepted
time: 757ms
memory: 100976kb

input:

1999 1287929
511744 45
173899208

output:

1 89346 27

result:

points 1.0 correct, ask1 called 89346 time(s), ask2 called 27 time(s)

Test #29:

score: 90
Accepted
time: 776ms
memory: 100592kb

input:

1996 513076
510976 45
511839519

output:

1 42165 25

result:

points 1.0 correct, ask1 called 42165 time(s), ask2 called 25 time(s)

Test #30:

score: 90
Accepted
time: 844ms
memory: 101404kb

input:

1999 2359752
511744 45
849845365

output:

1 89940 31

result:

points 1.0 correct, ask1 called 89940 time(s), ask2 called 31 time(s)

Test #31:

score: 90
Accepted
time: 746ms
memory: 100232kb

input:

1996 1905307
510976 45
114109388

output:

1 95121 26

result:

points 1.0 correct, ask1 called 95121 time(s), ask2 called 26 time(s)

Test #32:

score: 90
Accepted
time: 768ms
memory: 101164kb

input:

1999 3464342
511744 45
452082467

output:

1 111498 27

result:

points 1.0 correct, ask1 called 111498 time(s), ask2 called 27 time(s)

Test #33:

score: 90
Accepted
time: 767ms
memory: 101932kb

input:

1997 3041161
511232 45
790088314

output:

1 69328 24

result:

points 1.0 correct, ask1 called 69328 time(s), ask2 called 24 time(s)

Test #34:

score: 90
Accepted
time: 826ms
memory: 101416kb

input:

1999 605699
511744 45
54319568

output:

1 99778 29

result:

points 1.0 correct, ask1 called 99778 time(s), ask2 called 29 time(s)

Test #35:

score: 90
Accepted
time: 823ms
memory: 99904kb

input:

2000 3411048
512000 45
392325415

output:

1 90261 31

result:

points 1.0 correct, ask1 called 90261 time(s), ask2 called 31 time(s)

Test #36:

score: 90
Accepted
time: 856ms
memory: 101580kb

input:

1999 1677521
511744 45
730331262

output:

1 112212 26

result:

points 1.0 correct, ask1 called 112212 time(s), ask2 called 26 time(s)

Test #37:

score: 90
Accepted
time: 854ms
memory: 100940kb

input:

1997 1645949
511232 45
1068271572

output:

1 83850 29

result:

points 1.0 correct, ask1 called 83850 time(s), ask2 called 29 time(s)

Test #38:

score: 90
Accepted
time: 685ms
memory: 100152kb

input:

2000 1395508
512000 45
670508674

output:

1 82933 21

result:

points 1.0 correct, ask1 called 82933 time(s), ask2 called 21 time(s)

Test #39:

score: 90
Accepted
time: 752ms
memory: 100344kb

input:

2000 1045422
512000 45
1008514521

output:

1 82726 28

result:

points 1.0 correct, ask1 called 82726 time(s), ask2 called 28 time(s)

Test #40:

score: 90
Accepted
time: 676ms
memory: 101456kb

input:

2000 2404123
512000 45
272745775

output:

1 69184 22

result:

points 1.0 correct, ask1 called 69184 time(s), ask2 called 22 time(s)

Test #41:

score: 90
Accepted
time: 777ms
memory: 100816kb

input:

1998 2301912
511488 45
610751622

output:

1 103171 28

result:

points 1.0 correct, ask1 called 103171 time(s), ask2 called 28 time(s)

Test #42:

score: 90
Accepted
time: 767ms
memory: 100396kb

input:

2000 3412738
512000 45
948757469

output:

1 78320 27

result:

points 1.0 correct, ask1 called 78320 time(s), ask2 called 27 time(s)

Test #43:

score: 90
Accepted
time: 653ms
memory: 100596kb

input:

1998 3469663
511488 45
212988724

output:

1 52864 25

result:

points 1.0 correct, ask1 called 52864 time(s), ask2 called 25 time(s)

Test #44:

score: 90
Accepted
time: 755ms
memory: 100220kb

input:

1996 3617351
510976 45
550961802

output:

1 92064 25

result:

points 1.0 correct, ask1 called 92064 time(s), ask2 called 25 time(s)

Test #45:

score: 90
Accepted
time: 857ms
memory: 100660kb

input:

1998 710945
511488 45
888934881

output:

1 86174 28

result:

points 1.0 correct, ask1 called 86174 time(s), ask2 called 28 time(s)

Test #46:

score: 90
Accepted
time: 638ms
memory: 101192kb

input:

1999 2333740
511744 45
153198904

output:

1 46029 21

result:

points 1.0 correct, ask1 called 46029 time(s), ask2 called 21 time(s)

Test #47:

score: 90
Accepted
time: 789ms
memory: 101696kb

input:

1998 1878695
511488 45
491171982

output:

1 74133 26

result:

points 1.0 correct, ask1 called 74133 time(s), ask2 called 26 time(s)

Test #48:

score: 90
Accepted
time: 852ms
memory: 101416kb

input:

1997 3590574
511232 45
93441852

output:

1 107857 28

result:

points 1.0 correct, ask1 called 107857 time(s), ask2 called 28 time(s)

Test #49:

score: 90
Accepted
time: 837ms
memory: 100784kb

input:

1996 1801543
510976 45
431414931

output:

1 74050 27

result:

points 1.0 correct, ask1 called 74050 time(s), ask2 called 27 time(s)

Test #50:

score: 90
Accepted
time: 738ms
memory: 101204kb

input:

1999 3672188
511744 45
769420777

output:

1 85963 24

result:

points 1.0 correct, ask1 called 85963 time(s), ask2 called 24 time(s)

Test #51:

score: 90
Accepted
time: 737ms
memory: 99516kb

input:

1997 1535960
383424 38
726700757

output:

1 86029 26

result:

points 1.0 correct, ask1 called 86029 time(s), ask2 called 26 time(s)

Test #52:

score: 90
Accepted
time: 659ms
memory: 100656kb

input:

1999 3382611
383808 38
1064673836

output:

1 52592 24

result:

points 1.0 correct, ask1 called 52592 time(s), ask2 called 24 time(s)

Test #53:

score: 90
Accepted
time: 1046ms
memory: 102944kb

input:

1999 2544646
383808 38
328937859

output:

1 95000 34

result:

points 1.0 correct, ask1 called 95000 time(s), ask2 called 34 time(s)

Test #54:

score: 90
Accepted
time: 780ms
memory: 100424kb

input:

2000 3759384
384000 38
666910937

output:

1 73881 27

result:

points 1.0 correct, ask1 called 73881 time(s), ask2 called 27 time(s)

Test #55:

score: 90
Accepted
time: 724ms
memory: 100828kb

input:

2000 767997
384000 38
269148039

output:

1 111137 26

result:

points 1.0 correct, ask1 called 111137 time(s), ask2 called 26 time(s)

Test #56:

score: 90
Accepted
time: 671ms
memory: 100996kb

input:

1997 1437146
383424 38
607153886

output:

1 53763 24

result:

points 1.0 correct, ask1 called 53763 time(s), ask2 called 24 time(s)

Test #57:

score: 90
Accepted
time: 714ms
memory: 100912kb

input:

2000 1776612
384000 38
945159732

output:

1 59529 25

result:

points 1.0 correct, ask1 called 59529 time(s), ask2 called 25 time(s)

Test #58:

score: 90
Accepted
time: 806ms
memory: 100672kb

input:

1998 2265321
383616 38
209358219

output:

1 82778 27

result:

points 1.0 correct, ask1 called 82778 time(s), ask2 called 27 time(s)

Test #59:

score: 90
Accepted
time: 907ms
memory: 100300kb

input:

1997 1854922
383424 38
547364066

output:

1 50479 29

result:

points 1.0 correct, ask1 called 50479 time(s), ask2 called 29 time(s)

Test #60:

score: 90
Accepted
time: 728ms
memory: 100228kb

input:

1998 3465840
383616 38
885337145

output:

1 78749 26

result:

points 1.0 correct, ask1 called 78749 time(s), ask2 called 26 time(s)

Test #61:

score: 90
Accepted
time: 808ms
memory: 100668kb

input:

2000 2052285
384000 38
149601167

output:

1 111820 27

result:

points 1.0 correct, ask1 called 111820 time(s), ask2 called 27 time(s)

Test #62:

score: 90
Accepted
time: 789ms
memory: 100476kb

input:

1998 674354
383616 38
487574246

output:

1 84182 29

result:

points 1.0 correct, ask1 called 84182 time(s), ask2 called 29 time(s)

Test #63:

score: 90
Accepted
time: 643ms
memory: 100696kb

input:

1996 3620340
383232 38
825580093

output:

1 75234 26

result:

points 1.0 correct, ask1 called 75234 time(s), ask2 called 26 time(s)

Test #64:

score: 90
Accepted
time: 700ms
memory: 100020kb

input:

1998 1874872
383616 38
89844115

output:

1 108537 26

result:

points 1.0 correct, ask1 called 108537 time(s), ask2 called 26 time(s)

Test #65:

score: 90
Accepted
time: 709ms
memory: 100400kb

input:

1996 995786
383232 38
427817194

output:

1 64388 25

result:

points 1.0 correct, ask1 called 64388 time(s), ask2 called 25 time(s)

Test #66:

score: 90
Accepted
time: 768ms
memory: 101064kb

input:

1996 2420784
383232 38
30021528

output:

1 99336 27

result:

points 1.0 correct, ask1 called 99336 time(s), ask2 called 27 time(s)

Test #67:

score: 90
Accepted
time: 791ms
memory: 99764kb

input:

1999 3356599
383808 38
368027374

output:

1 54309 28

result:

points 1.0 correct, ask1 called 54309 time(s), ask2 called 28 time(s)

Test #68:

score: 90
Accepted
time: 791ms
memory: 100480kb

input:

1999 2485867
383808 38
706033221

output:

1 83906 31

result:

points 1.0 correct, ask1 called 83906 time(s), ask2 called 31 time(s)

Test #69:

score: 90
Accepted
time: 667ms
memory: 99628kb

input:

1997 2470380
383424 38
1044006300

output:

1 45850 22

result:

points 1.0 correct, ask1 called 45850 time(s), ask2 called 22 time(s)

Test #70:

score: 90
Accepted
time: 798ms
memory: 101888kb

input:

1996 1188460
383232 38
308270323

output:

1 112502 27

result:

points 1.0 correct, ask1 called 112502 time(s), ask2 called 27 time(s)

Test #71:

score: 90
Accepted
time: 839ms
memory: 101936kb

input:

1997 2799645
383424 38
646243401

output:

1 93918 29

result:

points 1.0 correct, ask1 called 93918 time(s), ask2 called 29 time(s)

Test #72:

score: 90
Accepted
time: 733ms
memory: 99696kb

input:

1999 699046
383808 38
984249248

output:

1 83666 25

result:

points 1.0 correct, ask1 called 83666 time(s), ask2 called 25 time(s)

Test #73:

score: 90
Accepted
time: 786ms
memory: 100176kb

input:

1999 3857083
383808 38
248447735

output:

1 71698 28

result:

points 1.0 correct, ask1 called 71698 time(s), ask2 called 28 time(s)

Test #74:

score: 65
Acceptable Answer
time: 873ms
memory: 99936kb

input:

2000 1079818
384000 38
586453581

output:

1 74227 35

result:

points 0.72222222220 correct, ask1 called 74227 time(s), ask2 called 35 time(s)

Test #75:

score: 90
Accepted
time: 675ms
memory: 99772kb

input:

1997 1404432
383424 38
924459428

output:

1 30834 22

result:

points 1.0 correct, ask1 called 30834 time(s), ask2 called 22 time(s)

Test #76:

score: 90
Accepted
time: 975ms
memory: 102752kb

input:

1997 2700831
383424 38
526696530

output:

1 104424 30

result:

points 1.0 correct, ask1 called 104424 time(s), ask2 called 30 time(s)

Test #77:

score: 90
Accepted
time: 763ms
memory: 101004kb

input:

2000 3097047
384000 38
864669608

output:

1 96383 26

result:

points 1.0 correct, ask1 called 96383 time(s), ask2 called 26 time(s)

Test #78:

score: 90
Accepted
time: 811ms
memory: 100616kb

input:

1998 3569764
383616 38
128933631

output:

1 111150 26

result:

points 1.0 correct, ask1 called 111150 time(s), ask2 called 26 time(s)

Test #79:

score: 90
Accepted
time: 749ms
memory: 101300kb

input:

1998 2103877
383616 38
466906710

output:

1 105248 24

result:

points 1.0 correct, ask1 called 105248 time(s), ask2 called 24 time(s)

Test #80:

score: 90
Accepted
time: 644ms
memory: 100444kb

input:

1998 778278
383616 38
804912557

output:

1 99571 20

result:

points 1.0 correct, ask1 called 99571 time(s), ask2 called 20 time(s)

Test #81:

score: 90
Accepted
time: 741ms
memory: 101212kb

input:

2000 2961353
256000 36
853017067

output:

1 72254 23

result:

points 1.0 correct, ask1 called 72254 time(s), ask2 called 23 time(s)

Test #82:

score: 90
Accepted
time: 786ms
memory: 100288kb

input:

1996 2578498
255488 36
117281089

output:

1 67902 28

result:

points 1.0 correct, ask1 called 67902 time(s), ask2 called 28 time(s)

Test #83:

score: 90
Accepted
time: 758ms
memory: 100684kb

input:

1996 3937961
255488 36
793260015

output:

1 79385 27

result:

points 1.0 correct, ask1 called 79385 time(s), ask2 called 27 time(s)

Test #84:

score: 90
Accepted
time: 782ms
memory: 100884kb

input:

1998 2345897
255744 36
57491270

output:

1 82209 28

result:

points 1.0 correct, ask1 called 82209 time(s), ask2 called 28 time(s)

Test #85:

score: 90
Accepted
time: 783ms
memory: 101940kb

input:

1996 1378943
255488 36
395497116

output:

1 80349 26

result:

points 1.0 correct, ask1 called 80349 time(s), ask2 called 26 time(s)

Test #86:

score: 90
Accepted
time: 593ms
memory: 99788kb

input:

1999 2734233
255872 36
733502963

output:

1 79644 21

result:

points 1.0 correct, ask1 called 79644 time(s), ask2 called 21 time(s)

Test #87:

score: 90
Accepted
time: 708ms
memory: 100116kb

input:

1999 1863500
255872 36
1071476042

output:

1 56435 24

result:

points 1.0 correct, ask1 called 56435 time(s), ask2 called 24 time(s)

Test #88:

score: 90
Accepted
time: 812ms
memory: 100956kb

input:

1999 3838824
255872 36
335740064

output:

1 96325 31

result:

points 1.0 correct, ask1 called 96325 time(s), ask2 called 31 time(s)

Test #89:

score: 90
Accepted
time: 789ms
memory: 101144kb

input:

1996 146619
255488 36
673680375

output:

1 72523 24

result:

points 1.0 correct, ask1 called 72523 time(s), ask2 called 24 time(s)

Test #90:

score: 90
Accepted
time: 876ms
memory: 102192kb

input:

1997 2897460
255616 36
1011686222

output:

1 104201 30

result:

points 1.0 correct, ask1 called 104201 time(s), ask2 called 30 time(s)

Test #91:

score: 90
Accepted
time: 696ms
memory: 101488kb

input:

2000 3588803
256000 36
275917477

output:

1 58048 24

result:

points 1.0 correct, ask1 called 58048 time(s), ask2 called 24 time(s)

Test #92:

score: 90
Accepted
time: 840ms
memory: 99492kb

input:

1999 2052003
255872 36
613923323

output:

1 101524 29

result:

points 1.0 correct, ask1 called 101524 time(s), ask2 called 29 time(s)

Test #93:

score: 90
Accepted
time: 952ms
memory: 102648kb

input:

2000 597416
256000 36
951929170

output:

1 107819 30

result:

points 1.0 correct, ask1 called 107819 time(s), ask2 called 30 time(s)

Test #94:

score: 90
Accepted
time: 784ms
memory: 100824kb

input:

1997 502346
255616 36
216160425

output:

1 59675 25

result:

points 1.0 correct, ask1 called 59675 time(s), ask2 called 25 time(s)

Test #95:

score: 90
Accepted
time: 628ms
memory: 101196kb

input:

1998 1639752
255744 36
892139350

output:

1 80562 24

result:

points 1.0 correct, ask1 called 80562 time(s), ask2 called 24 time(s)

Test #96:

score: 90
Accepted
time: 779ms
memory: 100592kb

input:

2000 2614645
256000 36
156370605

output:

1 86158 28

result:

points 1.0 correct, ask1 called 86158 time(s), ask2 called 28 time(s)

Test #97:

score: 90
Accepted
time: 698ms
memory: 100256kb

input:

1998 2807503
255744 36
494343684

output:

1 42945 24

result:

points 1.0 correct, ask1 called 42945 time(s), ask2 called 24 time(s)

Test #98:

score: 90
Accepted
time: 792ms
memory: 100808kb

input:

2000 3623260
256000 36
832349530

output:

1 89066 25

result:

points 1.0 correct, ask1 called 89066 time(s), ask2 called 25 time(s)

Test #99:

score: 90
Accepted
time: 727ms
memory: 99420kb

input:

1998 16016
255744 36
96613553

output:

1 60122 25

result:

points 1.0 correct, ask1 called 60122 time(s), ask2 called 25 time(s)

Test #100:

score: 90
Accepted
time: 633ms
memory: 100908kb

input:

1996 499201
255488 36
434586632

output:

1 77760 21

result:

points 1.0 correct, ask1 called 77760 time(s), ask2 called 21 time(s)

Test #101:

score: 90
Accepted
time: 730ms
memory: 101444kb

input:

1996 2183083
255488 36
772592479

output:

1 77384 27

result:

points 1.0 correct, ask1 called 77384 time(s), ask2 called 27 time(s)

Test #102:

score: 90
Accepted
time: 959ms
memory: 102496kb

input:

1996 1924199
255488 36
36823733

output:

1 86681 29

result:

points 1.0 correct, ask1 called 86681 time(s), ask2 called 29 time(s)

Test #103:

score: 90
Accepted
time: 807ms
memory: 101100kb

input:

1998 2417054
255744 36
374829580

output:

1 93905 31

result:

points 1.0 correct, ask1 called 93905 time(s), ask2 called 31 time(s)

Test #104:

score: 90
Accepted
time: 878ms
memory: 100164kb

input:

1999 966756
255872 36
712769891

output:

1 68655 27

result:

points 1.0 correct, ask1 called 68655 time(s), ask2 called 27 time(s)

Test #105:

score: 90
Accepted
time: 905ms
memory: 101864kb

input:

1997 271949
255616 36
1050775738

output:

1 84845 33

result:

points 1.0 correct, ask1 called 84845 time(s), ask2 called 33 time(s)

Test #106:

score: 90
Accepted
time: 726ms
memory: 100880kb

input:

1996 2634642
255488 36
315039760

output:

1 102504 22

result:

points 1.0 correct, ask1 called 102504 time(s), ask2 called 22 time(s)

Test #107:

score: 90
Accepted
time: 748ms
memory: 100868kb

input:

1997 1601116
255616 36
653012839

output:

1 94122 26

result:

points 1.0 correct, ask1 called 94122 time(s), ask2 called 26 time(s)

Test #108:

score: 90
Accepted
time: 831ms
memory: 100032kb

input:

1999 1155259
255872 36
255249940

output:

1 113060 28

result:

points 1.0 correct, ask1 called 113060 time(s), ask2 called 28 time(s)

Test #109:

score: 90
Accepted
time: 773ms
memory: 100256kb

input:

1999 284526
255872 36
593255787

output:

1 58476 29

result:

points 1.0 correct, ask1 called 58476 time(s), ask2 called 29 time(s)

Test #110:

score: 90
Accepted
time: 691ms
memory: 101112kb

input:

1997 173135
255616 36
931228866

output:

1 87321 26

result:

points 1.0 correct, ask1 called 87321 time(s), ask2 called 26 time(s)

Test #111:

score: 90
Accepted
time: 686ms
memory: 101056kb

input:

1996 2189413
127744 34
618447205

output:

1 85846 21

result:

points 1.0 correct, ask1 called 85846 time(s), ask2 called 21 time(s)

Test #112:

score: 90
Accepted
time: 701ms
memory: 101364kb

input:

1999 3781216
127936 34
956453051

output:

1 31688 21

result:

points 1.0 correct, ask1 called 31688 time(s), ask2 called 21 time(s)

Test #113:

score: 90
Accepted
time: 853ms
memory: 99760kb

input:

1996 3614412
127744 34
220684306

output:

1 92940 31

result:

points 1.0 correct, ask1 called 92940 time(s), ask2 called 31 time(s)

Test #114:

score: 90
Accepted
time: 661ms
memory: 101204kb

input:

1999 889805
127936 34
558690153

output:

1 43746 22

result:

points 1.0 correct, ask1 called 43746 time(s), ask2 called 22 time(s)

Test #115:

score: 90
Accepted
time: 788ms
memory: 100408kb

input:

1996 989857
127744 34
896663231

output:

1 77828 25

result:

points 1.0 correct, ask1 called 77828 time(s), ask2 called 25 time(s)

Test #116:

score: 90
Accepted
time: 678ms
memory: 101336kb

input:

1997 1962823
127808 34
498867565

output:

1 41827 24

result:

points 1.0 correct, ask1 called 41827 time(s), ask2 called 24 time(s)

Test #117:

score: 90
Accepted
time: 632ms
memory: 99708kb

input:

1999 3098986
127936 34
836873412

output:

1 30617 21

result:

points 1.0 correct, ask1 called 30617 time(s), ask2 called 21 time(s)

Test #118:

score: 90
Accepted
time: 886ms
memory: 100992kb

input:

2000 1712383
128000 34
101137434

output:

1 85248 31

result:

points 1.0 correct, ask1 called 85248 time(s), ask2 called 31 time(s)

Test #119:

score: 90
Accepted
time: 800ms
memory: 100236kb

input:

1997 1413465
127808 34
439110513

output:

1 93782 29

result:

points 1.0 correct, ask1 called 93782 time(s), ask2 called 29 time(s)

Test #120:

score: 90
Accepted
time: 760ms
memory: 100996kb

input:

1997 567610
127808 34
777116360

output:

1 77599 26

result:

points 1.0 correct, ask1 called 77599 time(s), ask2 called 26 time(s)

Test #121:

score: 90
Accepted
time: 669ms
memory: 100896kb

input:

1998 2586018
127872 34
41347615

output:

1 65526 24

result:

points 1.0 correct, ask1 called 65526 time(s), ask2 called 24 time(s)

Test #122:

score: 90
Accepted
time: 898ms
memory: 102004kb

input:

2000 3696844
128000 34
379353461

output:

1 65827 30

result:

points 1.0 correct, ask1 called 65827 time(s), ask2 called 30 time(s)

Test #123:

score: 90
Accepted
time: 731ms
memory: 101280kb

input:

2000 3346757
128000 34
717293772

output:

1 69417 24

result:

points 1.0 correct, ask1 called 69417 time(s), ask2 called 24 time(s)

Test #124:

score: 90
Accepted
time: 772ms
memory: 100988kb

input:

2000 738225
128000 34
1055299619

output:

1 62805 25

result:

points 1.0 correct, ask1 called 62805 time(s), ask2 called 25 time(s)

Test #125:

score: 90
Accepted
time: 668ms
memory: 99664kb

input:

1998 995051
127872 34
319563641

output:

1 39081 23

result:

points 1.0 correct, ask1 called 39081 time(s), ask2 called 23 time(s)

Test #126:

score: 90
Accepted
time: 634ms
memory: 100596kb

input:

1996 1342439
127744 34
657536720

output:

1 63543 23

result:

points 1.0 correct, ask1 called 63543 time(s), ask2 called 23 time(s)

Test #127:

score: 90
Accepted
time: 863ms
memory: 99624kb

input:

1998 2195569
127872 34
995542567

output:

1 94971 27

result:

points 1.0 correct, ask1 called 94971 time(s), ask2 called 27 time(s)

Test #128:

score: 90
Accepted
time: 750ms
memory: 101716kb

input:

1998 3396088
127872 34
597779668

output:

1 35975 25

result:

points 1.0 correct, ask1 called 35975 time(s), ask2 called 25 time(s)

Test #129:

score: 90
Accepted
time: 638ms
memory: 100560kb

input:

1996 2085649
127744 34
935752747

output:

1 86832 23

result:

points 1.0 correct, ask1 called 86832 time(s), ask2 called 23 time(s)

Test #130:

score: 90
Accepted
time: 739ms
memory: 100472kb

input:

1999 3989063
127936 34
199984002

output:

1 110236 25

result:

points 1.0 correct, ask1 called 110236 time(s), ask2 called 25 time(s)

Test #131:

score: 90
Accepted
time: 843ms
memory: 99932kb

input:

1996 3477880
127744 34
537989849

output:

1 60359 33

result:

points 1.0 correct, ask1 called 60359 time(s), ask2 called 33 time(s)

Test #132:

score: 90
Accepted
time: 803ms
memory: 101036kb

input:

1999 1064883
127936 34
875962927

output:

1 101533 30

result:

points 1.0 correct, ask1 called 101533 time(s), ask2 called 30 time(s)

Test #133:

score: 90
Accepted
time: 832ms
memory: 100424kb

input:

1999 194151
127936 34
140226950

output:

1 89546 30

result:

points 1.0 correct, ask1 called 89546 time(s), ask2 called 30 time(s)

Test #134:

score: 90
Accepted
time: 791ms
memory: 102324kb

input:

1999 2202242
127936 34
478200029

output:

1 79066 24

result:

points 1.0 correct, ask1 called 79066 time(s), ask2 called 24 time(s)

Test #135:

score: 90
Accepted
time: 803ms
memory: 101800kb

input:

1997 1962877
127808 34
816205876

output:

1 99913 26

result:

points 1.0 correct, ask1 called 99913 time(s), ask2 called 26 time(s)

Test #136:

score: 90
Accepted
time: 894ms
memory: 100112kb

input:

1997 1084254
127808 34
80437130

output:

1 92248 33

result:

points 1.0 correct, ask1 called 92248 time(s), ask2 called 33 time(s)

Test #137:

score: 90
Accepted
time: 775ms
memory: 101288kb

input:

2000 1991435
128000 34
418442977

output:

1 72322 32

result:

points 1.0 correct, ask1 called 72322 time(s), ask2 called 32 time(s)

Test #138:

score: 90
Accepted
time: 856ms
memory: 101120kb

input:

1999 382653
127936 34
756448824

output:

1 105245 28

result:

points 1.0 correct, ask1 called 105245 time(s), ask2 called 28 time(s)

Test #139:

score: 90
Accepted
time: 819ms
memory: 101280kb

input:

2000 3032817
128000 34
20647310

output:

1 74849 26

result:

points 1.0 correct, ask1 called 74849 time(s), ask2 called 26 time(s)

Test #140:

score: 90
Accepted
time: 797ms
memory: 101836kb

input:

1997 1864063
127808 34
696626236

output:

1 73624 24

result:

points 1.0 correct, ask1 called 73624 time(s), ask2 called 24 time(s)