错误记录

  1. 可能再某些oj上ce(如accoding.cn) 
    #include<bits/stdc++.h>
    
  2. 1 struct Node{
    2     int o,d;
    3     Node(){}
    4     Node(int o,int d):o(o),d(d){}
    5     bool operator < (const Node &aa)const{
    6         return d>aa.d;
    7     }    
    8 };

    优先队列重载运算符

  3. 1 priority_queue<Node> Q;
    2 Q.push(Node(1,0));//都是小括号
  4. 多组不定数据输入
    1 while(~scanf("%d",&n)){
    2 }
  5. while(~scanf("%c",&a) &&'0'<=a &&a<='9')    
        s+=a-'0';

    不定长度数字串输入

  6. 最小公倍数=a*b-gcd(a,b) --> 不要通过分解质因数来求最大公倍数qwq,用辗转相除即可。
  7. 仔细计算题目中可能出现的最大值,直接用可能最大的数据类型,提高1A的概率
  8. 判断char s[100] 字符串相等,应该用 strcmp(s1,s2)==0 表示
  9.  向上取整 ceil(x)  x是double,ceil返回值也是double,头文件是math.h
原文地址:https://www.cnblogs.com/xln1111/p/11490115.html