• 提答题 总结


    写在前面:

    主要用来存数据

    computer

    1

    node 1
    read 0 a
    write a 0
    1

    2

    node 1
    read 0 a
    add a 4
    jmp a
    write 0 0
    write 1 0
    write 1 0
    write 2 0
    write 3 0
    write 5 0
    write 8 0
    write 13 0
    write 21 0
    write 34 0
    write 55 0
    write 89 0
    write 144 0
    write 233 0
    write 377 0
    write 610 0
    write 987 0
    write 1597 0
    write 2584 0
    write 4181 0
    write 6765 0
    write 10946 0
    write 17711 0
    write 28657 0
    write 46368 0
    write 75025 0
    write 121393 0
    write 196418 0
    write 317811 0
    write 514229 0
    write 832040 0
    write 1346269 0
    write 2178309 0
    write 3524578 0
    write 5702887 0
    write 9227465 0
    write 14930352 0
    write 24157817 0
    write 39088169 0
    write 63245986 0
    write 102334155 0
    write 165580141 0
    write 267914296 0
    write 433494437 0
    write 701408733 0
    2

    3

    node 1
    read 0 a
    write a 7
    node 7
    read 1 a
    write a 13
    node 13
    read 7 a
    write a 54
    node 54
    read 13 a
    write a 40
    node 40
    read 54 a
    write a 50
    node 50
    read 40 a
    write a 36
    node 36
    read 50 a
    write a 37
    node 37
    read 36 a
    write a 56
    node 56
    read 37 a
    write a 98
    node 98
    read 56 a
    write a 80
    node 80
    read 98 a
    write a 100
    node 100
    read 80 a
    write a 0
    3

    4

    node 1
    read 0 a
    write a 273
    node 2
    read 0 a
    write a 54
    node 3
    read 0 a
    write a 97
    node 4
    read 0 a
    write a 406
    node 5
    read 0 a
    write a 277
    node 6
    read 0 a
    write a 924
    node 7
    read 0 a
    write a 53
    node 8
    read 0 a
    write a 691
    node 9
    read 0 a
    write a 82
    node 10
    read 0 a
    write a 763
    node 11
    read 0 a
    write a 562
    node 12
    read 0 a
    write a 90
    node 13
    read 0 a
    write a 469
    node 14
    read 0 a
    write a 946
    node 15
    read 0 a
    write a 81
    node 16
    read 0 a
    write a 915
    node 17
    read 0 a
    write a 620
    node 18
    read 0 a
    write a 92
    read 978 b
    write b 96
    node 19
    read 0 a
    write a 524
    node 20
    read 0 a
    write a 401
    node 21
    read 0 a
    write a 319
    node 22
    read 0 a
    write a 274
    node 23
    read 0 a
    write a 912
    node 24
    read 0 a
    write a 485
    node 25
    read 0 a
    write a 893
    node 26
    read 0 a
    write a 57
    node 27
    read 0 a
    write a 790
    node 28
    read 0 a
    write a 255
    node 29
    read 0 a
    write a 93
    node 30
    read 0 a
    write a 553
    node 31
    read 0 a
    write a 333
    node 32
    read 0 a
    write a 53
    node 33
    read 0 a
    write a 619
    node 34
    read 0 a
    write a 917
    node 35
    read 0 a
    write a 972
    node 36
    read 0 a
    write a 567
    node 37
    read 0 a
    write a 316
    read 44 b
    write b 618
    node 38
    read 0 a
    write a 864
    node 39
    read 0 a
    write a 745
    node 40
    read 0 a
    write a 74
    node 41
    read 0 a
    write a 249
    node 42
    read 0 a
    write a 975
    node 43
    read 0 a
    write a 758
    node 44
    read 0 a
    write a 37
    node 45
    read 0 a
    write a 786
    node 46
    read 0 a
    write a 763
    node 47
    read 0 a
    write a 410
    node 48
    read 0 a
    write a 768
    node 49
    read 0 a
    write a 564
    node 50
    read 0 a
    write a 297
    node 51
    read 714 a
    write a 0
    node 52
    read 316 a
    write a 0
    node 53
    read 7 a
    write a 0
    read 32 b
    write b 922
    node 54
    read 2 a
    write a 0
    node 55
    read 789 a
    write a 0
    node 56
    read 718 a
    write a 0
    node 57
    read 26 a
    write a 0
    node 58
    read 319 a
    write a 0
    node 59
    read 768 a
    write a 0
    node 60
    read 389 a
    write a 0
    node 61
    read 808 a
    write a 0
    node 62
    read 249 a
    write a 0
    node 63
    read 922 a
    write a 0
    node 64
    read 410 a
    write a 0
    node 65
    read 203 a
    write a 0
    node 66
    read 562 a
    write a 0
    node 67
    read 893 a
    write a 0
    node 68
    read 917 a
    write a 0
    node 69
    read 249 a
    write a 0
    node 70
    read 770 a
    write a 0
    read 924 b
    write b 72
    node 71
    read 912 a
    write a 0
    node 72
    read 70 a
    write a 0
    node 73
    read 350 a
    write a 0
    node 74
    read 40 a
    write a 0
    node 75
    read 333 a
    write a 0
    node 76
    read 753 a
    write a 0
    node 77
    read 973 a
    write a 0
    node 78
    read 745 a
    write a 0
    node 79
    read 581 a
    write a 0
    node 80
    read 437 a
    write a 0
    node 81
    read 15 a
    write a 0
    node 82
    read 9 a
    write a 0
    node 83
    read 289 a
    write a 0
    node 84
    read 571 a
    write a 0
    node 85
    read 361 a
    write a 0
    node 86
    read 255 a
    write a 0
    node 87
    read 98 a
    write a 0
    node 88
    read 711 a
    write a 0
    node 89
    read 618 a
    write a 0
    node 90
    read 12 a
    write a 0
    node 91
    read 763 a
    write a 0
    node 92
    read 18 a
    write a 0
    node 93
    read 29 a
    write a 0
    node 94
    read 526 a
    write a 0
    node 95
    read 564 a
    write a 0
    node 96
    read 18 a
    write a 0
    node 97
    read 3 a
    write a 0
    node 98
    read 277 a
    write a 87
    read 619 b
    write b 0
    node 99
    read 944 a
    write a 0
    node 100
    read 790 a
    write a 0
    node 102
    read 691 a
    write a 571
    node 170
    read 934 a
    write a 714
    node 196
    read 915 a
    write a 289
    node 203
    read 973 a
    write a 65
    node 220
    read 946 a
    write a 350
    node 249
    read 972 a
    write a 69
    read 41 b
    write b 62
    node 255
    read 28 a
    write a 86
    node 273
    read 1 a
    write a 770
    node 274
    read 22 a
    write a 794
    node 277
    read 5 a
    write a 98
    node 289
    read 196 a
    write a 83
    node 297
    read 50 a
    write a 973
    node 316
    read 37 a
    write a 52
    node 319
    read 21 a
    write a 58
    read 786 b
    write b 753
    node 333
    read 950 a
    write a 973
    read 31 b
    write b 75
    node 341
    read 598 a
    write a 978
    node 350
    read 220 a
    write a 73
    node 361
    read 567 a
    write a 85
    node 389
    read 654 a
    write a 60
    node 401
    read 20 a
    write a 808
    node 406
    read 4 a
    write a 581
    node 410
    read 47 a
    write a 64
    node 437
    read 945 a
    write a 80
    node 469
    read 13 a
    write a 654
    node 485
    read 24 a
    write a 954
    node 510
    read 954 a
    write a 945
    node 524
    read 19 a
    write a 692
    node 526
    read 763 a
    write a 94
    node 553
    read 30 a
    write a 718
    node 562
    read 11 a
    write a 66
    node 564
    read 49 a
    write a 95
    node 567
    read 36 a
    write a 361
    node 571
    read 102 a
    write a 915
    read 915 b
    write b 84
    node 581
    read 406 a
    write a 79
    node 589
    read 620 a
    write a 918
    node 598
    read 640 a
    write a 341
    node 618
    read 37 a
    write a 89
    node 619
    read 33 a
    write a 98
    node 620
    read 17 a
    write a 589
    node 640
    read 975 a
    write a 598
    node 654
    read 469 a
    write a 389
    node 691
    read 8 a
    write a 102
    node 692
    read 524 a
    write a 801
    node 711
    read 945 a
    write a 88
    node 714
    read 170 a
    write a 51
    node 718
    read 553 a
    write a 56
    node 719
    read 801 a
    write a 945
    node 745
    read 39 a
    write a 78
    node 753
    read 319 a
    write a 76
    node 758
    read 43 a
    write a 789
    node 763
    read 10 a
    write a 526
    read 46 b
    write b 91
    node 768
    read 48 a
    write a 59
    node 770
    read 273 a
    write a 70
    node 786
    read 45 a
    write a 319
    node 789
    read 758 a
    write a 55
    node 790
    read 27 a
    write a 100
    node 794
    read 274 a
    write a 944
    node 801
    read 692 a
    write a 719
    node 808
    read 401 a
    write a 61
    node 864
    read 38 a
    write a 934
    node 893
    read 25 a
    write a 67
    node 912
    read 23 a
    write a 71
    node 915
    read 571 a
    write a 196
    read 16 b
    write b 571
    node 917
    read 34 a
    write a 68
    node 918
    read 589 a
    write a 950
    node 922
    read 53 a
    write a 63
    node 924
    read 6 a
    write a 70
    node 934
    read 864 a
    write a 170
    node 944
    read 794 a
    write a 99
    node 945
    read 719 a
    write a 711
    read 510 b
    write b 437
    node 946
    read 14 a
    write a 220
    node 950
    read 918 a
    write a 333
    node 954
    read 485 a
    write a 510
    node 972
    read 35 a
    write a 249
    node 973
    read 333 a
    write a 77
    read 297 b
    write b 203
    node 975
    read 42 a
    write a 640
    node 978
    read 341 a
    write a 18
    4
    #include<bits/stdc++.h>
    using namespace std;
    signed main()
    {
            freopen("result.out","r",stdin);
            int n=0,m;
            while(scanf("%d",&m)!=EOF)
            {
                    n++;
            }
            if(n==50) while(1);
            return 0;
    }
    T4对拍
    #include<bits/stdc++.h>
    using namespace std;
    signed main()
    {
            int sum=0;
            while(1)
            {
                    sum++;
                    system("./1");
                    system("chmod +x checker");
                    system("ulimit -s unlimited");
                    system("./checker 1.in 2.in 3.in 9 -detail");
                    system("./2");
                    cout<<sum<<" Accepted"<<endl;
            }
            return 0;
    }
    #include<bits/stdc++.h>
    using namespace std;
    const int N=4e5+10;
    int cnt,ans,S,T,tot=1,t,n,m,vis[N],p[N],bl[N],dis[N],pre[N],head[N],to[N],ne[N],w[N],d[N];
    vector<int>v[N],L[N],R[N],c[N];
    struct edge
    {
            int x,y,z;
            friend bool operator <(edge l,edge r)
            {
                    return l.z<r.z;
            }
    }e[N];
    void add(int x,int y,int z)
    {
            to[++tot]=y;
            w[tot]=z;
            ne[tot]=head[x];
            head[x]=tot;
    }
    void link(int x,int y,int z)
    {
            add(x,y,z),add(y,x,0);
    }
    bool bfs()
    {
            queue<int>q;
            q.push(S);
            memset(d,0,sizeof(d));
            d[S]=1;
            while(q.size())
            {
                    int x=q.front();
                    q.pop();
                    for(int i=head[x];i;i=ne[i])
                    {
                            int y=to[i];
                            if(!w[i]||d[y]) continue;
                            d[y]=d[x]+1;
                            if(y==T) return true;
                            q.push(y);
                    }
            }
            return false;
    }
    int dfs(int x,int in)
    {
            if(x==T) return in;
            int out=0;
            for(int i=head[x];i;i=ne[i])
            {
                    int y=to[i];
                    if(d[y]!=d[x]+1||!w[i]) continue;
                    int tmp=dfs(y,min(in,w[i]));
                    w[i]-=tmp,w[i^1]+=tmp;
                    in-=tmp,out+=tmp;
            }
            if(!in) d[x]=-1;
            return out;
    }
    void solve(int T,int x)
    {
            if(x==S) return;
            v[T].push_back(x);
            vis[x]=T;
            for(int i=head[x];i;i=ne[i])
            {
                    int y=to[i];
                    if(!w[i]||vis[y]==T||(!(i&1))) continue;
                    w[i]=0;
                    solve(T,y);
                    return;
            }
    }
    signed main()
    {
            freopen("1.in","r",stdin);
            freopen("3.in","w",stdout);
            srand(time(0));
            cin>>t>>n>>m;
            cnt=n;
            S=++cnt,T=++cnt;
            for(int i=1,x,y;i<=m;i++)
            {
                    cin>>e[i].x>>e[i].y;
                    e[i].z=rand();
            }
            sort(e+1,e+m+1);
            for(int i=1;i<=m;i++) link(e[i].x,e[i].y,1),link(e[i].y,e[i].x,1);
            for(int i=1;i<=50;i++) link(S,i,1);
            for(int i=51;i<=100;i++) link(i,T,1),bl[i]=tot;
            while(bfs()) ans+=dfs(S,50);
            memset(vis,0,sizeof(vis));
            for(int i=1;i<=50;i++) p[i]=i+50;
            random_shuffle(p+1,p+51);
            for(int i=1;i<=50;i++) 
            {
                    int x=p[i];
                    solve(x,x);
                    v[x].push_back(0);
            }
            memset(vis,0,sizeof(vis));
            for(int k=1;k<=50;k++)
            {
                    for(int i=51;i<=100;i++)
                    {
                            if(v[i][v[i].size()-2]!=k) continue;
                            for(int j=v[i].size()-2;j>-1;j--) 
                            {
                                    L[v[i][j]].push_back(0);
                                    R[v[i][j]].push_back(v[i][j+1]);
                                    c[v[i][j]].push_back(vis[v[i][j]]);
                                    L[v[i][j]].push_back(1);
                                    R[v[i][j]].push_back((j==0?0:v[i][j-1]));
                                    c[v[i][j]].push_back(vis[v[i][j]]);
                                    vis[v[i][j]]++;
                                    //cout<<"node "<<v[i][j]<<endl;
                                    //cout<<"read "<<v[i][j+1]<<" a"<<endl;
                                    //cout<<"write a "<<(j==0?0:v[i][j-1])<<endl;
                            }
                    }
            }
            for(int i=1;i<=n;i++)
            {
                    if(!L[i].size()) continue;
                    cout<<"node "<<i<<endl;
                    for(int j=0;j<L[i].size();j++)
                    {
                            if(L[i][j]==0)
                            {
                                    if(!c[i][j]) cout<<"read "<<R[i][j]<<" a"<<endl;
                                    else cout<<"read "<<R[i][j]<<" b"<<endl;
                            }
                            else
                            {
                                    if(!c[i][j]) cout<<"write a "<<R[i][j]<<endl;
                                    else cout<<"write b "<<R[i][j]<<endl;
                            }
                    }
            }
            return 0;
    }
    T4对拍

    5

    NPIO十合一

    485595551
    259213919
    642938600
    152300811
    427390545

    (用AKT的电脑跑的我的代码,我的机子内存只有别人的一半,实力不济,就没什么好跑的,现在的竟然还有2G运存的电脑,服了)
    147996440
    676893319
    520480262
    390615953
    564246904

    T3

    1.0000000000
    5.5000000000
    50.5000000000
    512.5000000000
    5000.5000000000
    10000.5000000000
    25000.5000000000
    50000.5000000000
    262144.5000000000
    500000.5000000000

    500000.5000000000
    90909.5909099242
    9901.4901073432
    976.1098414309
    100.4908343318
    50.4991667806
    20.5037665011
    10.5082319458
    2.4508368037
    1.5819757107

    1.0000000000
    29.2896825397
    518.7377517640
    7689.3958884128
    97876.0603604438
    209614.5643445866
    569850.1974639241
    1209014.6129863428
    7207393.9775465754
    14392726.7228657238

    2.0000000000
    4.6602156800
    13.2099606302
    40.7759540999
    125.9991218681
    177.9127887997
    280.9166939770
    396.9997264084
    908.1631825165
    1253.9809083954

    1.0000000000
    5.7272727273
    14.3853465347
    24.0292721037
    34.0885123088
    37.0867562322
    41.0687214944
    44.0683007510
    51.0000915526
    53.8543196792

    1.0000000000
    34.4373015873
    747.8502585632
    12321.8101281702
    165771.6959329597
    359250.0901456076
    989723.1889357468
    2118053.4062649453
    12841951.4491192494
    25785482.2311848932

    1.0000000000

    1.0000000000
    4.4166666667
    28.1317460317
    225.4437199375
    1875.1266218504
    3603.9174000074
    8589.7543682233
    16617.4318428392
    81112.0906579545
    150840.8786720902

    1.0000000000
    3.8203654070
    9.5093370808
    10.0000000000
    10.0000000000
    10.0000000000
    10.0000000000
    10.0000000000
    10.0000000000
    10.0000000000

    0.9999900000
    9.9997000057

  • 相关阅读:
    题解 P2647 【最大收益】
    CF817E Choosing The Commander
    P2922 [USACO08DEC]Secret Message G
    洛谷月赛 P7107 天选之人
    如何在考场上快速用C++写高级对拍器
    题解 CF527D 【Clique Problem】
    P6768 [USACO05MAR]Ombrophobic Bovines 发抖的牛
    [USACO06NOV]Corn Fields G
    Orz 教主的比赛题解
    JZOI 4311 统一天下
  • 原文地址:https://www.cnblogs.com/AthosD/p/12198291.html
Copyright © 2020-2023  润新知