zoukankan      html  css  js  c++  java
  • Codeforces Round #388 (Div. 2)

    A水,总是忘记输出个数

    #include<map>
    #include<set>
    #include<cmath>
    #include<queue>
    #include<stack>
    #include<vector>
    #include<cstdio>
    #include<cassert>
    #include<iomanip>
    #include<cstdlib>
    #include<cstring>
    #include<iostream>
    #include<algorithm>
    #define C 0.5772156649
    #define pi acos(-1.0)
    #define ll long long
    #define mod 1000000007
    #define ls l,m,rt<<1
    #define rs m+1,r,rt<<1|1
    #pragma comment(linker, "/STACK:1024000000,1024000000")
    
    using namespace std;
    
    const double g=10.0,eps=1e-7;
    const int N=35000+10,maxn=500+100,inf=0x3f3f3f;
    
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        int n;
        cin>>n;
        vector<int>v;
        if(n&1)
        {
            v.push_back(3);
            n-=3;
        }
        while(n>0)
        {
            v.push_back(2);
            n-=2;
        }
        cout<<v.size()<<endl;
        for(int i=0;i<v.size();i++)
            cout<<v[i]<<" ";
        cout<<endl;
        return 0;
    }
    /********************
    
    ********************/
    A

    B平行四边形,一定是三个点

    #include<map>
    #include<set>
    #include<cmath>
    #include<queue>
    #include<stack>
    #include<vector>
    #include<cstdio>
    #include<cassert>
    #include<iomanip>
    #include<cstdlib>
    #include<cstring>
    #include<iostream>
    #include<algorithm>
    #define C 0.5772156649
    #define pi acos(-1.0)
    #define ll long long
    #define mod 1000000007
    #define ls l,m,rt<<1
    #define rs m+1,r,rt<<1|1
    #pragma comment(linker, "/STACK:1024000000,1024000000")
    
    using namespace std;
    
    const double g=10.0,eps=1e-7;
    const int N=35000+10,maxn=500+100,inf=0x3f3f3f;
    
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        int x[3],y[3];
        for(int i=0;i<3;i++)
            cin>>x[i]>>y[i];
        cout<<3<<endl;
        cout<<x[0]+x[2]-x[1]<<" "<<y[0]+y[2]-y[1]<<endl;
        cout<<x[0]-x[2]+x[1]<<" "<<y[0]-y[2]+y[1]<<endl;
        cout<<x[1]+x[2]-x[0]<<" "<<y[1]+y[2]-y[0]<<endl;
        return 0;
    }
    /********************
    
    ********************/
    B

    C两个队列维护进去的时间,判断哪个时间大,就pop那个,时间小的加到队列尾,时间+n

    #include<map>
    #include<set>
    #include<cmath>
    #include<queue>
    #include<stack>
    #include<vector>
    #include<cstdio>
    #include<cassert>
    #include<iomanip>
    #include<cstdlib>
    #include<cstring>
    #include<iostream>
    #include<algorithm>
    #define C 0.5772156649
    #define pi acos(-1.0)
    #define ll long long
    #define mod 1000000007
    #define ls l,m,rt<<1
    #define rs m+1,r,rt<<1|1
    #pragma comment(linker, "/STACK:1024000000,1024000000")
    
    using namespace std;
    
    const double g=10.0,eps=1e-7;
    const int N=35000+10,maxn=500+100,inf=0x3f3f3f;
    
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        int x[3],y[3];
        for(int i=0;i<3;i++)
            cin>>x[i]>>y[i];
        cout<<3<<endl;
        cout<<x[0]+x[2]-x[1]<<" "<<y[0]+y[2]-y[1]<<endl;
        cout<<x[0]-x[2]+x[1]<<" "<<y[0]-y[2]+y[1]<<endl;
        cout<<x[1]+x[2]-x[0]<<" "<<y[1]+y[2]-y[0]<<endl;
        return 0;
    }
    /********************
    
    ********************/
    C
  • 相关阅读:
    Mysql字符串字段判断是否包含某个字符串的方法
    linux下安装jenkins实现自动化部署
    Python:webshell 跳板机审计服务器
    Yum:更换aliyun的yum源
    Python:安装3.6
    Mysql:零散记录
    Kvm:通过 libvirt 远程管理虚拟机
    Python:socket实现ftp程序
    Python:用户自定义异常
    Kvm:启动报错:error: internal error: process exited while connecting to monitor: 2018-11-12T01:47:14.993371Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
  • 原文地址:https://www.cnblogs.com/acjiumeng/p/7265027.html
Copyright © 2011-2022 走看看