QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#183444#5375. SearchLynkcat75 886ms103168kbC++205.1kb2023-09-19 15:23:412023-09-19 15:23:41

Judging History

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

  • [2023-09-19 15:23:41]
  • 评测
  • 测评结果:75
  • 用时:886ms
  • 内存:103168kb
  • [2023-09-19 15:23:41]
  • 提交

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 (tot&&t1+tot*(__lg(tot))>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));
            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;
    }
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

6 3
384 45
837639677

output:

1 103 6

result:

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

Test #2:

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

input:

8 59
512 45
439876779

output:

1 250 7

result:

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

Test #3:

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

input:

9 27
576 45
777817090

output:

1 328 8

result:

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

Test #4:

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

input:

7 14
448 45
42081112

output:

1 147 7

result:

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

Test #5:

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

input:

6 14
384 45
380054191

output:

1 94 6

result:

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

Test #6:

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

input:

9 13
576 45
718060038

output:

1 321 8

result:

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

Test #7:

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

input:

9 16
576 45
1056065885

output:

1 309 7

result:

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

Test #8:

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

input:

7 41
448 45
320297139

output:

1 144 7

result:

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

Test #9:

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

input:

7 33
448 45
658302986

output:

1 154 7

result:

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

Test #10:

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

input:

7 30
448 45
996276065

output:

1 185 6

result:

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

Test #11:

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

input:

7 37
448 45
598480398

output:

1 139 7

result:

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

Test #12:

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

input:

10 27
640 45
936486245

output:

1 428 7

result:

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

Test #13:

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

input:

8 22
512 45
200750268

output:

1 228 7

result:

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

Test #14:

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

input:

10 41
640 45
538723346

output:

1 422 8

result:

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

Test #15:

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

input:

6 35
384 45
876729193

output:

1 121 6

result:

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

Test #16:

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

input:

10 98
640 45
140960448

output:

1 422 8

result:

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

Test #17:

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

input:

8 36
512 45
478966295

output:

1 242 7

result:

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

Test #18:

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

input:

8 9
512 45
81170628

output:

1 257 7

result:

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

Test #19:

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

input:

6 20
384 45
419176475

output:

1 111 6

result:

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

Test #20:

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

input:

6 23
384 45
757149553

output:

1 107 7

result:

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

Subtask #2:

score: 65
Acceptable Answer

Test #21:

score: 90
Accepted
time: 722ms
memory: 102840kb

input:

1998 997469
511488 45
691176210

output:

1 121537 25

result:

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

Test #22:

score: 65
Acceptable Answer
time: 763ms
memory: 100396kb

input:

1997 250682
511232 45
1029182057

output:

1 137847 29

result:

points 0.72222222220 correct, ask1 called 137847 time(s), ask2 called 29 time(s)

Test #23:

score: 90
Accepted
time: 626ms
memory: 99552kb

input:

2000 1742216
512000 45
293413312

output:

1 72525 22

result:

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

Test #24:

score: 90
Accepted
time: 720ms
memory: 101020kb

input:

1996 2394420
510976 45
631419158

output:

1 115257 28

result:

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

Test #25:

score: 90
Accepted
time: 616ms
memory: 101108kb

input:

1998 3398507
511488 45
969425005

output:

1 55247 22

result:

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

Test #26:

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

input:

1998 574252
511488 45
571662106

output:

1 51454 28

result:

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

Test #27:

score: 90
Accepted
time: 747ms
memory: 100440kb

input:

1996 1162097
510976 45
909635185

output:

1 104593 29

result:

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

Test #28:

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

input:

1999 1287929
511744 45
173899208

output:

1 90488 31

result:

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

Test #29:

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

input:

1996 513076
510976 45
511839519

output:

1 123735 28

result:

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

Test #30:

score: 65
Acceptable Answer
time: 693ms
memory: 99480kb

input:

1999 2359752
511744 45
849845365

output:

1 145603 28

result:

points 0.72222222220 correct, ask1 called 145603 time(s), ask2 called 28 time(s)

Test #31:

score: 90
Accepted
time: 710ms
memory: 100556kb

input:

1996 1905307
510976 45
114109388

output:

1 126191 27

result:

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

Test #32:

score: 65
Acceptable Answer
time: 827ms
memory: 100464kb

input:

1999 3464342
511744 45
452082467

output:

1 111387 35

result:

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

Test #33:

score: 65
Acceptable Answer
time: 736ms
memory: 101600kb

input:

1997 3041161
511232 45
790088314

output:

1 133853 25

result:

points 0.72222222220 correct, ask1 called 133853 time(s), ask2 called 25 time(s)

Test #34:

score: 90
Accepted
time: 627ms
memory: 101920kb

input:

1999 605699
511744 45
54319568

output:

1 87337 23

result:

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

Test #35:

score: 90
Accepted
time: 666ms
memory: 101624kb

input:

2000 3411048
512000 45
392325415

output:

1 109583 25

result:

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

Test #36:

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

input:

1999 1677521
511744 45
730331262

output:

1 104216 30

result:

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

Test #37:

score: 65
Acceptable Answer
time: 700ms
memory: 101376kb

input:

1997 1645949
511232 45
1068271572

output:

1 133796 28

result:

points 0.72222222220 correct, ask1 called 133796 time(s), ask2 called 28 time(s)

Test #38:

score: 65
Acceptable Answer
time: 664ms
memory: 101324kb

input:

2000 1395508
512000 45
670508674

output:

1 132112 25

result:

points 0.72222222220 correct, ask1 called 132112 time(s), ask2 called 25 time(s)

Test #39:

score: 90
Accepted
time: 717ms
memory: 100324kb

input:

2000 1045422
512000 45
1008514521

output:

1 115789 29

result:

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

Test #40:

score: 90
Accepted
time: 604ms
memory: 100124kb

input:

2000 2404123
512000 45
272745775

output:

1 38482 23

result:

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

Test #41:

score: 90
Accepted
time: 710ms
memory: 99568kb

input:

1998 2301912
511488 45
610751622

output:

1 91492 31

result:

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

Test #42:

score: 65
Acceptable Answer
time: 666ms
memory: 101428kb

input:

2000 3412738
512000 45
948757469

output:

1 137878 25

result:

points 0.72222222220 correct, ask1 called 137878 time(s), ask2 called 25 time(s)

Test #43:

score: 90
Accepted
time: 619ms
memory: 100652kb

input:

1998 3469663
511488 45
212988724

output:

1 73465 25

result:

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

Test #44:

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

input:

1996 3617351
510976 45
550961802

output:

1 115776 29

result:

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

Test #45:

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

input:

1998 710945
511488 45
888934881

output:

1 100553 27

result:

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

Test #46:

score: 90
Accepted
time: 609ms
memory: 101792kb

input:

1999 2333740
511744 45
153198904

output:

1 74036 21

result:

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

Test #47:

score: 65
Acceptable Answer
time: 666ms
memory: 100828kb

input:

1998 1878695
511488 45
491171982

output:

1 130715 27

result:

points 0.72222222220 correct, ask1 called 130715 time(s), ask2 called 27 time(s)

Test #48:

score: 90
Accepted
time: 615ms
memory: 100732kb

input:

1997 3590574
511232 45
93441852

output:

1 53841 23

result:

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

Test #49:

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

input:

1996 1801543
510976 45
431414931

output:

1 98725 29

result:

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

Test #50:

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

input:

1999 3672188
511744 45
769420777

output:

1 48854 26

result:

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

Test #51:

score: 90
Accepted
time: 703ms
memory: 99924kb

input:

1997 1535960
383424 38
726700757

output:

1 120448 25

result:

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

Test #52:

score: 90
Accepted
time: 683ms
memory: 100640kb

input:

1999 3382611
383808 38
1064673836

output:

1 96506 28

result:

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

Test #53:

score: 90
Accepted
time: 697ms
memory: 99824kb

input:

1999 2544646
383808 38
328937859

output:

1 104936 27

result:

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

Test #54:

score: 90
Accepted
time: 660ms
memory: 99728kb

input:

2000 3759384
384000 38
666910937

output:

1 123333 25

result:

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

Test #55:

score: 90
Accepted
time: 666ms
memory: 99504kb

input:

2000 767997
384000 38
269148039

output:

1 51550 24

result:

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

Test #56:

score: 90
Accepted
time: 666ms
memory: 100780kb

input:

1997 1437146
383424 38
607153886

output:

1 62824 26

result:

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

Test #57:

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

input:

2000 1776612
384000 38
945159732

output:

1 69763 28

result:

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

Test #58:

score: 65
Acceptable Answer
time: 759ms
memory: 101064kb

input:

1998 2265321
383616 38
209358219

output:

1 138995 28

result:

points 0.72222222220 correct, ask1 called 138995 time(s), ask2 called 28 time(s)

Test #59:

score: 90
Accepted
time: 655ms
memory: 99800kb

input:

1997 1854922
383424 38
547364066

output:

1 102036 27

result:

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

Test #60:

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

input:

1998 3465840
383616 38
885337145

output:

1 101635 25

result:

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

Test #61:

score: 90
Accepted
time: 655ms
memory: 101372kb

input:

2000 2052285
384000 38
149601167

output:

1 99034 25

result:

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

Test #62:

score: 90
Accepted
time: 629ms
memory: 100708kb

input:

1998 674354
383616 38
487574246

output:

1 86832 24

result:

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

Test #63:

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

input:

1996 3620340
383232 38
825580093

output:

1 118528 26

result:

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

Test #64:

score: 90
Accepted
time: 765ms
memory: 102244kb

input:

1998 1874872
383616 38
89844115

output:

1 120152 26

result:

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

Test #65:

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

input:

1996 995786
383232 38
427817194

output:

1 96700 24

result:

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

Test #66:

score: 65
Acceptable Answer
time: 794ms
memory: 100872kb

input:

1996 2420784
383232 38
30021528

output:

1 133837 30

result:

points 0.72222222220 correct, ask1 called 133837 time(s), ask2 called 30 time(s)

Test #67:

score: 90
Accepted
time: 666ms
memory: 100812kb

input:

1999 3356599
383808 38
368027374

output:

1 117364 23

result:

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

Test #68:

score: 90
Accepted
time: 697ms
memory: 100916kb

input:

1999 2485867
383808 38
706033221

output:

1 124111 26

result:

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

Test #69:

score: 90
Accepted
time: 687ms
memory: 100384kb

input:

1997 2470380
383424 38
1044006300

output:

1 104728 26

result:

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

Test #70:

score: 65
Acceptable Answer
time: 650ms
memory: 100516kb

input:

1996 1188460
383232 38
308270323

output:

1 131401 24

result:

points 0.72222222220 correct, ask1 called 131401 time(s), ask2 called 24 time(s)

Test #71:

score: 90
Accepted
time: 759ms
memory: 100512kb

input:

1997 2799645
383424 38
646243401

output:

1 93279 28

result:

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

Test #72:

score: 90
Accepted
time: 834ms
memory: 99756kb

input:

1999 699046
383808 38
984249248

output:

1 96766 32

result:

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

Test #73:

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

input:

1999 3857083
383808 38
248447735

output:

1 67334 22

result:

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

Test #74:

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

input:

2000 1079818
384000 38
586453581

output:

1 92869 30

result:

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

Test #75:

score: 90
Accepted
time: 705ms
memory: 101392kb

input:

1997 1404432
383424 38
924459428

output:

1 97056 27

result:

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

Test #76:

score: 90
Accepted
time: 662ms
memory: 100600kb

input:

1997 2700831
383424 38
526696530

output:

1 116103 22

result:

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

Test #77:

score: 90
Accepted
time: 759ms
memory: 100944kb

input:

2000 3097047
384000 38
864669608

output:

1 63217 27

result:

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

Test #78:

score: 90
Accepted
time: 566ms
memory: 100532kb

input:

1998 3569764
383616 38
128933631

output:

1 105650 20

result:

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

Test #79:

score: 65
Acceptable Answer
time: 626ms
memory: 100852kb

input:

1998 2103877
383616 38
466906710

output:

1 143304 23

result:

points 0.72222222220 correct, ask1 called 143304 time(s), ask2 called 23 time(s)

Test #80:

score: 90
Accepted
time: 693ms
memory: 100432kb

input:

1998 778278
383616 38
804912557

output:

1 60797 26

result:

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

Test #81:

score: 90
Accepted
time: 682ms
memory: 101624kb

input:

2000 2961353
256000 36
853017067

output:

1 89340 29

result:

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

Test #82:

score: 65
Acceptable Answer
time: 700ms
memory: 100192kb

input:

1996 2578498
255488 36
117281089

output:

1 145383 27

result:

points 0.72222222220 correct, ask1 called 145383 time(s), ask2 called 27 time(s)

Test #83:

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

input:

1996 3937961
255488 36
793260015

output:

1 109763 27

result:

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

Test #84:

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

input:

1998 2345897
255744 36
57491270

output:

1 37044 24

result:

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

Test #85:

score: 65
Acceptable Answer
time: 794ms
memory: 101608kb

input:

1996 1378943
255488 36
395497116

output:

1 132162 31

result:

points 0.72222222220 correct, ask1 called 132162 time(s), ask2 called 31 time(s)

Test #86:

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

input:

1999 2734233
255872 36
733502963

output:

1 46499 25

result:

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

Test #87:

score: 65
Acceptable Answer
time: 697ms
memory: 100624kb

input:

1999 1863500
255872 36
1071476042

output:

1 137014 24

result:

points 0.72222222220 correct, ask1 called 137014 time(s), ask2 called 24 time(s)

Test #88:

score: 65
Acceptable Answer
time: 787ms
memory: 100304kb

input:

1999 3838824
255872 36
335740064

output:

1 148195 27

result:

points 0.72222222220 correct, ask1 called 148195 time(s), ask2 called 27 time(s)

Test #89:

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

input:

1996 146619
255488 36
673680375

output:

1 81993 27

result:

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

Test #90:

score: 90
Accepted
time: 655ms
memory: 101104kb

input:

1997 2897460
255616 36
1011686222

output:

1 107458 26

result:

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

Test #91:

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

input:

2000 3588803
256000 36
275917477

output:

1 122549 29

result:

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

Test #92:

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

input:

1999 2052003
255872 36
613923323

output:

1 78884 30

result:

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

Test #93:

score: 90
Accepted
time: 684ms
memory: 101536kb

input:

2000 597416
256000 36
951929170

output:

1 114308 26

result:

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

Test #94:

score: 90
Accepted
time: 703ms
memory: 100456kb

input:

1997 502346
255616 36
216160425

output:

1 123839 30

result:

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

Test #95:

score: 90
Accepted
time: 558ms
memory: 101276kb

input:

1998 1639752
255744 36
892139350

output:

1 54166 21

result:

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

Test #96:

score: 65
Acceptable Answer
time: 628ms
memory: 99520kb

input:

2000 2614645
256000 36
156370605

output:

1 137944 24

result:

points 0.72222222220 correct, ask1 called 137944 time(s), ask2 called 24 time(s)

Test #97:

score: 90
Accepted
time: 795ms
memory: 102060kb

input:

1998 2807503
255744 36
494343684

output:

1 104137 26

result:

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

Test #98:

score: 90
Accepted
time: 626ms
memory: 100860kb

input:

2000 3623260
256000 36
832349530

output:

1 95225 25

result:

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

Test #99:

score: 65
Acceptable Answer
time: 886ms
memory: 103168kb

input:

1998 16016
255744 36
96613553

output:

1 135725 31

result:

points 0.72222222220 correct, ask1 called 135725 time(s), ask2 called 31 time(s)

Test #100:

score: 65
Acceptable Answer
time: 605ms
memory: 100092kb

input:

1996 499201
255488 36
434586632

output:

1 131229 23

result:

points 0.72222222220 correct, ask1 called 131229 time(s), ask2 called 23 time(s)

Test #101:

score: 90
Accepted
time: 511ms
memory: 100156kb

input:

1996 2183083
255488 36
772592479

output:

1 40540 19

result:

points 1.0 correct, ask1 called 40540 time(s), ask2 called 19 time(s)

Test #102:

score: 65
Acceptable Answer
time: 704ms
memory: 100196kb

input:

1996 1924199
255488 36
36823733

output:

1 127898 31

result:

points 0.72222222220 correct, ask1 called 127898 time(s), ask2 called 31 time(s)

Test #103:

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

input:

1998 2417054
255744 36
374829580

output:

1 124591 27

result:

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

Test #104:

score: 90
Accepted
time: 699ms
memory: 99424kb

input:

1999 966756
255872 36
712769891

output:

1 64321 30

result:

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

Test #105:

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

input:

1997 271949
255616 36
1050775738

output:

1 69759 28

result:

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

Test #106:

score: 65
Acceptable Answer
time: 696ms
memory: 99756kb

input:

1996 2634642
255488 36
315039760

output:

1 149584 30

result:

points 0.72222222220 correct, ask1 called 149584 time(s), ask2 called 30 time(s)

Test #107:

score: 65
Acceptable Answer
time: 721ms
memory: 101936kb

input:

1997 1601116
255616 36
653012839

output:

1 142694 26

result:

points 0.72222222220 correct, ask1 called 142694 time(s), ask2 called 26 time(s)

Test #108:

score: 90
Accepted
time: 590ms
memory: 100044kb

input:

1999 1155259
255872 36
255249940

output:

1 119393 23

result:

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

Test #109:

score: 90
Accepted
time: 604ms
memory: 100352kb

input:

1999 284526
255872 36
593255787

output:

1 63445 24

result:

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

Test #110:

score: 90
Accepted
time: 575ms
memory: 101340kb

input:

1997 173135
255616 36
931228866

output:

1 112887 22

result:

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

Test #111:

score: 65
Acceptable Answer
time: 659ms
memory: 100876kb

input:

1996 2189413
127744 34
618447205

output:

1 138978 27

result:

points 0.72222222220 correct, ask1 called 138978 time(s), ask2 called 27 time(s)

Test #112:

score: 90
Accepted
time: 616ms
memory: 100052kb

input:

1999 3781216
127936 34
956453051

output:

1 49560 25

result:

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

Test #113:

score: 90
Accepted
time: 680ms
memory: 100512kb

input:

1996 3614412
127744 34
220684306

output:

1 57268 24

result:

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

Test #114:

score: 65
Acceptable Answer
time: 715ms
memory: 100576kb

input:

1999 889805
127936 34
558690153

output:

1 130248 29

result:

points 0.72222222220 correct, ask1 called 130248 time(s), ask2 called 29 time(s)

Test #115:

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

input:

1996 989857
127744 34
896663231

output:

1 104856 27

result:

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

Test #116:

score: 90
Accepted
time: 649ms
memory: 100132kb

input:

1997 1962823
127808 34
498867565

output:

1 121056 26

result:

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

Test #117:

score: 90
Accepted
time: 743ms
memory: 102264kb

input:

1999 3098986
127936 34
836873412

output:

1 44116 27

result:

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

Test #118:

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

input:

2000 1712383
128000 34
101137434

output:

1 75268 24

result:

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

Test #119:

score: 90
Accepted
time: 690ms
memory: 99576kb

input:

1997 1413465
127808 34
439110513

output:

1 114666 26

result:

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

Test #120:

score: 90
Accepted
time: 677ms
memory: 100492kb

input:

1997 567610
127808 34
777116360

output:

1 100304 23

result:

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

Test #121:

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

input:

1998 2586018
127872 34
41347615

output:

1 107310 23

result:

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

Test #122:

score: 90
Accepted
time: 598ms
memory: 101160kb

input:

2000 3696844
128000 34
379353461

output:

1 73625 23

result:

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

Test #123:

score: 65
Acceptable Answer
time: 703ms
memory: 99504kb

input:

2000 3346757
128000 34
717293772

output:

1 141669 28

result:

points 0.72222222220 correct, ask1 called 141669 time(s), ask2 called 28 time(s)

Test #124:

score: 90
Accepted
time: 736ms
memory: 101844kb

input:

2000 738225
128000 34
1055299619

output:

1 105481 25

result:

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

Test #125:

score: 90
Accepted
time: 579ms
memory: 100924kb

input:

1998 995051
127872 34
319563641

output:

1 31724 21

result:

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

Test #126:

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

input:

1996 1342439
127744 34
657536720

output:

1 125647 28

result:

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

Test #127:

score: 90
Accepted
time: 574ms
memory: 99496kb

input:

1998 2195569
127872 34
995542567

output:

1 119531 21

result:

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

Test #128:

score: 65
Acceptable Answer
time: 644ms
memory: 101324kb

input:

1998 3396088
127872 34
597779668

output:

1 134343 26

result:

points 0.72222222220 correct, ask1 called 134343 time(s), ask2 called 26 time(s)

Test #129:

score: 65
Acceptable Answer
time: 806ms
memory: 101136kb

input:

1996 2085649
127744 34
935752747

output:

1 131114 32

result:

points 0.72222222220 correct, ask1 called 131114 time(s), ask2 called 32 time(s)

Test #130:

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

input:

1999 3989063
127936 34
199984002

output:

1 81248 31

result:

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

Test #131:

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

input:

1996 3477880
127744 34
537989849

output:

1 70529 24

result:

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

Test #132:

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

input:

1999 1064883
127936 34
875962927

output:

1 110546 24

result:

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

Test #133:

score: 90
Accepted
time: 718ms
memory: 100460kb

input:

1999 194151
127936 34
140226950

output:

1 95162 30

result:

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

Test #134:

score: 65
Acceptable Answer
time: 771ms
memory: 99904kb

input:

1999 2202242
127936 34
478200029

output:

1 133726 31

result:

points 0.72222222220 correct, ask1 called 133726 time(s), ask2 called 31 time(s)

Test #135:

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

input:

1997 1962877
127808 34
816205876

output:

1 108524 29

result:

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

Test #136:

score: 65
Acceptable Answer
time: 719ms
memory: 100480kb

input:

1997 1084254
127808 34
80437130

output:

1 131671 27

result:

points 0.72222222220 correct, ask1 called 131671 time(s), ask2 called 27 time(s)

Test #137:

score: 90
Accepted
time: 603ms
memory: 99844kb

input:

2000 1991435
128000 34
418442977

output:

1 111861 22

result:

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

Test #138:

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

input:

1999 382653
127936 34
756448824

output:

1 98420 25

result:

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

Test #139:

score: 65
Acceptable Answer
time: 684ms
memory: 100876kb

input:

2000 3032817
128000 34
20647310

output:

1 132560 23

result:

points 0.72222222220 correct, ask1 called 132560 time(s), ask2 called 23 time(s)

Test #140:

score: 90
Accepted
time: 785ms
memory: 102152kb

input:

1997 1864063
127808 34
696626236

output:

1 71839 32

result:

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