zoukankan      html  css  js  c++  java
  • 语法问题

    https://codeforces.com/blog/entry/15643

    scanf

    scanf("%c",&c); 可以输入换行符
    scanf("%s",s+1); 不会读取换行符

    pair<int,int> p;
    p = {3,4};
    
    vector<int>v;
    v = {3,4,5,6};
    

    tuple

    tuple<int,int,int> t;
    t = {1,2,3};
    int x =  get<1>(t);
    cout<<x<<endl;
    

    builtin

    int x = __builtin_ffs(16);//返回最低位1的位置
    int y = __builtin_ctz(16);//返回尾0的个数
    int z = __builtin_popcount(x);//返回1的个数
    

    Output

    for(i = 1; i <= n; i++)
        for(j = 1; j <= m; j++)
            cout << a[i][j] << " 
    "[j == m];
    

    pow

    今天long long范围内调用了pow函数,然后WA了

    改成这样就过了,待解决

    ll p(ll a,ll b){
        ll ans = 1;
        for(ll i=1;i<=b;i==){
            ans*=a;
        }
        return ans;
    }
    

    vector<vector>

    vector<vector<int>> pre(m, vector<int>(n + 1));
    

    相当于开了一个int pre[m][n+1]的数组,但是不会MLE((sum n leq {10}^5))

    反正是动态的

  • 相关阅读:
    0802作业1替换文本文件内容

    看病
    爬山
    作业1
    超市(未完成)
    图片复制
    替换
    文件
    英文字母和中文汉字在不同字符集编码下的字节数
  • 原文地址:https://www.cnblogs.com/guaguastandup/p/12585193.html
Copyright © 2011-2022 走看看