zoukankan      html  css  js  c++  java
  • unordered_map cin && cout 外挂

    int read()
    {
        char ch = getchar();
        int flag = 1 , ans = 0;
        while(ch<'0' || ch>'9')      if(ch=='-') flag = -1 , ch=getchar();
        while(ch>='0' && ch<='9') ans = ans*10+ch-'0',ch = getchar();
        return flag*ans;
    }
     __int128 read()
     {
        __int128 x=0,f=1;
        char ch=getchar();
        while(ch<'0'||ch>'9')  { if(ch=='-') f=-1;  ch=getchar();    }
        while(ch>='0'&&ch<='9'){ x=x*10+ch-'0';ch=getchar();    }
        return x*f;
    }
     void print(__int128 x){
        if(x<0) { putchar('-');x=-x; }
        if(x>9) print(x/10);
        putchar(x%10+'0');
    }
    int main(void)
    {
        __int128 a = read();
        __int128 b = read();
        print(a + b);
        cout<<endl;
        return 0;
    }
    // A
    #include <bits/stdc++.h> #define ll long long using namespace std; //unordered_map <string , int > ump; const int mxn = 1e5+10; int n,m,k,a[mxn] , dp[mxn]; string str , ch ; int cmp(int a,int b) { return a>b; } int main() { ios::sync_with_stdio(false); while(cin>>n&&n) { int i; for(i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+1+n); for(int i=1;i<=n;i++) dp[i] = a[n-i+1]; for(int i=2;i<=n;i++) { a[i] = a[i]*a[i-1]+1; dp[i] = dp[i]*dp[i-1]+1; sort(a+i,a+1+n); sort(dp+i,dp+1+n,cmp); } cout<<abs(dp[n]-a[n])<<endl; } return 0; }
    // B
    #include <bits/stdc++.h> #define ll long long using namespace std; //unordered_map <string , int > ump; int n,m,k; string str , ch ; int main() { ios::sync_with_stdio(false); while(cin>>str>>ch) { if(str.size()!=ch.size()) cout<<"WRONG_ANSWER"<<endl; else { sort(str.begin(),str.end()); if(str[0]=='0') { for(int i=1;i<str.size();i++) if(str[i]!='0') { swap(str[0],str[i]); break; } } if(str==ch) cout<<"OK"<<endl; else cout<<"WRONG_ANSWER"<<endl; } } return 0; }
    //   G
    #include <bits/stdc++.h>
    #define ll long long
    using namespace std;
    unordered_map <string , int > ump;
    string str ;
    int n,m,k;
    int main()
    {
        while(cin>>n)
        {
            while(n--)
            {
                cin>>str;
                if(ump.find(str)!=ump.end())
                {
                    cout<<str<<ump[str]<<endl;
                    ump[str]++;
                }
                else
                {
                    cout<<"OK"<<endl;
                    ump[str]++;
                }
            }
        }
        return 0;
    }
    所遇皆星河
  • 相关阅读:
    文件系列--截取路径字符串,获取文件名
    ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同
    大小写字母,特殊字符,数字,四选一组合或者全组合,长度至少八位,验证
    设计模式-23种设计模式介绍
    &和&&区别
    GridView中Button多参数传参
    HTTP 错误 500.19
    Windows系统添加端口号
    win10安装IIS服务
    2019最新整理PHP面试题附答案
  • 原文地址:https://www.cnblogs.com/Shallow-dream/p/11944732.html
Copyright © 2011-2022 走看看