![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tips
bekote
这个作者很懒,什么都没留下…
展开
-
input/output || tips || %f && %lf
scanf:double 用%lf,float 用%f; printf:最好用%f输出,不然会莫名其妙wa到你哭原创 2018-09-22 23:15:06 · 152 阅读 · 0 评论 -
图论 || Silver Cow Party(单向边来回最短路径)
I - Silver Cow Party One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M≤ 100,000) un...原创 2018-09-21 17:33:27 · 339 阅读 · 0 评论 -
tips || memset赋值无穷大无穷小
memset(a,127,sizeof(a)); 即得到无穷大 memset(a,128,sizeof(a)); 即得到无穷小原创 2018-09-14 16:32:40 · 344 阅读 · 1 评论 -
补题向 | Hard to prepare(pow)
Hard to prepare 题目来源 ACM-ICPC 2018 徐州赛区网络预赛 n个数字围成一圈,每个数字范围[0, ],问有多少种不同的序列满足对于所有相邻的两个数字,它们异或值不能为(二进制每个位不都为1),第一个数字和最后一个数字也算相邻。(0<n,k≤1e6) 。 存在两种情况 假设第1个数字有2^k种选择,第2到第n-1个数字均有2^k-1种选择(保证与前...原创 2018-09-14 12:07:50 · 182 阅读 · 0 评论 -
补题向 | Trace(set、lower_bound())
Trace Output An Integer stands for the answer. Hint: As for the sample input, the answer is 3+3+1+1+1+1=103+3+1+1+1+1=10 题目来源 ACM-ICPC 2018 徐州赛区网络预赛 n个浪打上沙滩,(x,y)代表浪会打湿沙滩形成坐标(0,0),(x,0...原创 2018-09-12 22:45:05 · 164 阅读 · 0 评论 -
补题向 | Maximal Intersection(multiset)
Maximal Intersection 给出n对数,代表一条线段的左右端点位置,求删去其中一条线段之后,剩余的线段交叉的长度最大是多少(剩余所有线段的公共部分) 对于一些交叉的线段,他们公共部分为最大的左端点到最小的右端点 如果线段不交叉,那么最大的左端点到最小右端点为负数,依题意,公共部分长度视为0 使用multiset,和set一样可以自动排序,不同点在于multiset中可...原创 2018-08-29 16:51:30 · 205 阅读 · 0 评论 -
补题向 | Concatenated Multiples(map int和string转换)
Concatenated Multiples 给出n个数和k,两个数组合而成一个新数,这个新数能被k整除,有多少个这样的组合 假如数13和2,k为4,组合成132,对k求余,可以看成130%k+2%k,要知道132%k是不是等于k,相当于求k-(130%k)等不等于2 在上面例子里,13后面加一个0是由2的位数决定的 存在一种特殊情况,自己和自己组合可以被k整除 使用map<...原创 2018-08-31 00:21:41 · 316 阅读 · 0 评论 -
刷题向 | tips | map逆向迭代器
#include<stdio.h> #include<vector> #include<algorithm> #include<string.h> #include<iostream> #include<limits> #include<fstream> #include<math.h&原创 2018-11-09 17:14:21 · 213 阅读 · 0 评论