zoukankan      html  css  js  c++  java
  • 其他注意事项

    1.设置环境:-Wl,-stack=512000000 -Wall -Wextra -Wconversion

    2.一定设置自动保存!!!

    3.对拍程序:a+b problem为例

    正解1:

    #include<bits/stdc++.h>
    using namespace std;
    
    int n,m;
    
    int main()
    {
        cin>>n>>m;
        cout<<n+m<<endl;
        return 0;
    }

    正解2:

    #include<bits/stdc++.h>
    using namespace std;
    /*
    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||(ch>'9'));
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0'&&ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }*/
    
    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||ch>'9');
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0')&&(ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }
    
    int n,m;
    
    int main()
    {
        n=read();m=read();
        printf("%d
    ",n+m);
        return 0;
    }

    随机数:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        srand(time(0));
        cout<<rand()%15564<<" "<<rand()%545345;
    }

    对拍:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        while(1)
        {
            system("suijishu>in.txt");
            system("a+b<in.txt>out.txt");
            system("4578<in.txt>ans.txt");
            if(system("fc out.txt ans.txt"))
            break;
        }    
        return 0;
    }

    4.一定用万能头!!!

    5.快读:

    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||ch>'9');
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0')&&(ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }

    随时补充

    -----------end-------------

  • 相关阅读:
    算法:最大回文子串问题
    Python HTTP库requests中文页面乱码解决方案!
    Python:默认参数
    在博客园开通个人博客了
    JQ选择器
    C# 接口
    C# 微信公众平台开发(2) 微信菜单
    C# 微信公众平台开发(1) 服务器配置
    博客园开博第一天!记录生活,扬帆启航!
    JavaScript判断、循环、Map、Set
  • 原文地址:https://www.cnblogs.com/yxr001002/p/14082224.html
Copyright © 2011-2022 走看看