摘要:
注意点 浮点数不能用“==”判断是否相等,需要用abs(x1-x2)<=0.00001的方式 代码 #include <iostream> #include <cstdio> #include <string> #include <cmath> using namespace std; const 阅读全文
posted @ 2022-07-13 18:40
qwasdasd
阅读(27)
评论(0)
推荐(0)
摘要:
代码 #include <iostream> #include <cstdio> #include <string> using namespace std; int a[20000]; int main() { int n; int cnt=0; cin>>n; for(int i=0;i<200 阅读全文
posted @ 2022-07-13 14:35
qwasdasd
阅读(31)
评论(0)
推荐(0)
摘要:
代码 #include <iostream> #include <cstdio> #include <string> #include <map> #include <set> #include <utility> #include <vector> #include <algorithm> usi 阅读全文
posted @ 2022-07-13 14:29
qwasdasd
阅读(33)
评论(0)
推荐(0)
摘要:
注意点 bool cmp_diy(const pair3& a,const pair3& b){//const xxx & x 作用是引用某个变量,只读它的内容,但不能修改这个引用的变量 代码 #include <iostream> #include <cstdio> #include <strin 阅读全文
posted @ 2022-07-13 14:24
qwasdasd
阅读(20)
评论(0)
推荐(0)
摘要:
易错点 测试点4超时 解决方案 tmps=tmps+tmpc+to_string(tmp); 改成 tmps+=tmpc+to_string(tmp); 原因 a+=b比a=a+b快很多! 因此+=的形式不仅仅是代码书写习惯的问题,关系到代码运行速度,可以尽量写成+=的形式。 代码 #include 阅读全文
posted @ 2022-07-13 13:09
qwasdasd
阅读(22)
评论(0)
推荐(0)
摘要:
代码 #include <iostream> #include <cstdio> #include <cmath> using namespace std; int r[10001]; int main() { int n; int a; for(int i=0;i<10001;i++){ r[i] 阅读全文
posted @ 2022-07-13 12:24
qwasdasd
阅读(14)
评论(0)
推荐(0)
摘要:
代码 #include <iostream> #include <cstdio> #include <cmath> #include <string> using namespace std; int main() { int n; string id; float x,y; float p; fl 阅读全文
posted @ 2022-07-13 12:18
qwasdasd
阅读(25)
评论(0)
推荐(0)
摘要:
易错点 输入格式中提到:“每行给出一个用户设置的密码,为不超过 80 个字符的非空字符串”,因此可能包含空格。测试点2即包含空格,如果用“cin>>a",测试点2会过不去,需要用cin.getline() 代码 #include <iostream> #include <cstdio> #inclu 阅读全文
posted @ 2022-07-13 12:10
qwasdasd
阅读(34)
评论(0)
推荐(0)
摘要:
易错点 测试点3:如果总评用float,测试点3会报错,换成int后能ac,原因不解 注意点 utility中的pair放到vector后用sort()可以对pair中的两个值进行自定义排序 代码 #include <iostream> #include <cstdio> #include <str 阅读全文
posted @ 2022-07-13 11:23
qwasdasd
阅读(66)
评论(0)
推荐(0)

浙公网安备 33010602011771号