第十届四川省ACM赛前总结

PS:(头脑风暴,想到什么,写什么)

1、1e10     ==    1 * 10 ^ (10)

2、ArithmeticException  == 算术异常

3、  BigInteger a = new BigInteger("12");

  BigInteger.valueof("12");  // 都是对Biginteger进行初始化

  加法:add

  减法:substract

  乘法:multiply

  除法:divide

  大数的最大公约数:gcd

  etc...

扫描二维码关注公众号,回复: 1425156 查看本文章

4、同余定理实用于 “加法”、“乘法”,eg:(a+b)%p = ((a%p) + (b%p))%p

5、可以通过map<int, string, greater<int> >,定义map容器,以降序排列

6、priority_queue <int, vector<int>, cmp> q; // 优先队列

   priority_queue <long, vector<long>, greater<long> > q; // 优先队列

   priority_queue <node> q; //优先队列

   bool operator < (const node a, const node b)

   {

       return a.cnt > b.cnt;

      }

7、a<<=1;  等价于  a*=2;

   a>>=1;  等价于  a/=2;

8、getline(cin, s);  // 以行为单位输入字符串

9、atof  // String转化为float型

10、stable_sort(A, A+n, cmp); // 稳定排序

11、isalnum(); // 判断输入的字符串是否为字母或数字

12、ceil(x); // 大于x的最小整数 (向上取整)

13、floor(x);  //小于或等于x的最大整数 (向下取整)

14、sscanf("123456fff", "%d", &n); // 其中 n = 123456

15、printf("%.*lf", x, a); // 将a按照x位小数缩进

16、ios::sync_with_stdio(false); // 加快cin、cout的速度

17、Itoa(int temp, char*, int n) ;//temp转化成n进制的数放在char* 中

18、并查集pre, my_find(); my_join();

19、KMP,AC自动机

猜你喜欢

转载自www.cnblogs.com/GetcharZp/p/9127741.html