A1001
https://www.cnblogs.com/zhuqiwei-blog/p/8442154.html
1、依次取一个数字的每一位,用
do{
num = c % 10;
c = c / 10;
}while(c != 0); //注意是c不是num
A1002
http://www.cnblogs.com/zhuqiwei-blog/p/8430912.html
A1003
http://www.cnblogs.com/zhuqiwei-blog/p/8553172.html
1、迪杰斯特拉易错点:
dst、visit、pre、G的初始化
每次选出一个最短点作为u,并将其visit标记
在优化其他点时,要判断其未被visit标记,且距离不是INF
优化时要更新dst
2、fill(dst, dst + 501, INF); //一维数组 fill(G[0], G[0] + 501*501, INF);//二维数组
A1004
http://www.cnblogs.com/zhuqiwei-blog/p/8542282.html
1、错误:在if条件内更新重要数据,if不执行时就出现了bug
2、层序遍历时,由于是树,不会产生回路,不需要visit记录。 如果是BFS则需要visit数组记录已经进入过队列的元素。
A1005
http://www.cnblogs.com/zhuqiwei-blog/p/8442239.html
A1006
http://www.cnblogs.com/zhuqiwei-blog/p/8433315.html
A1008
http://www.cnblogs.com/zhuqiwei-blog/p/8515937.html
提交oj的代码最好不要有time关键字命名,会编译错误。
A1009
http://www.cnblogs.com/zhuqiwei-blog/p/8431284.html
A1011
http://www.cnblogs.com/zhuqiwei-blog/p/8432711.html
A1012
http://www.cnblogs.com/zhuqiwei-blog/p/8453853.html
1、struct 结构体可以直接赋值,但成员中有数组时,还需要单独拷贝。struct 中含有数组成员,在sort函数中不需要单独拷贝。
A1013
http://www.cnblogs.com/zhuqiwei-blog/p/8549142.html
1、图的遍历,在广搜和深搜都可行的情况下,使用深搜更加简洁快速。
A1014*
https://www.cnblogs.com/zhuqiwei-blog/p/8567284.html
STL总结:https://www.cnblogs.com/zhuqiwei-blog/p/8536281.html
1、模拟排队等题,首先要设计好合适的数据结构和数据项来模拟题中的场景。
A1015
https://www.cnblogs.com/zhuqiwei-blog/p/8519714.html
1、转换进制:除基取余法, do while。
2、素数判断。
A1016*
https://www.cnblogs.com/zhuqiwei-blog/p/8491093.html
1、cmp函数中,若a == b, 应返回false。即 返回true的因该是严格小于: a < b。否则会出现错误 invalid operator < 。
2、处理完得到待输出的列表时,按题目要求输出比较麻烦,这里要注意。
A1017*
https://www.cnblogs.com/zhuqiwei-blog/p/8566715.html
A1018*
https://www.cnblogs.com/zhuqiwei-blog/p/8560737.html
1、初始化G时,fill(G[0], G[0] + 501*501, INF);而非fill(G[0], G[0] + (N +1)*(N+1), INF);
A1019
https://www.cnblogs.com/zhuqiwei-blog/p/8439087.html
A1020
https://www.cnblogs.com/zhuqiwei-blog/p/8537195.html
1、中序分出左右子树后,在对应的后序序列中,仍是做子树在左半边,右子树在右半边。
A1021*
https://www.cnblogs.com/zhuqiwei-blog/p/8552755.html
1、并查集。
2、深搜。
3、debug时分为两部分检查代码,一是模板部分;而是本题的逻辑部分。
A1022
https://www.cnblogs.com/zhuqiwei-blog/p/8528870.html
1、int num; cin >> num; cin操作无法吸收num后面的换行符,在cin后再cin 一个char c也不行。
A1023
https://www.cnblogs.com/zhuqiwei-blog/p/8522368.html
1、超长整数求和运算。
2、哈希表。
A1024
https://www.cnblogs.com/zhuqiwei-blog/p/8522627.html
A1025
https://www.cnblogs.com/zhuqiwei-blog/p/8448767.html
A1026*
A1027
https://www.cnblogs.com/zhuqiwei-blog/p/8439152.html
A1028
https://www.cnblogs.com/zhuqiwei-blog/p/8491200.html
A1029
https://www.cnblogs.com/zhuqiwei-blog/p/8513944.html
A1030
https://www.cnblogs.com/zhuqiwei-blog/p/8557032.html
A1031
https://www.cnblogs.com/zhuqiwei-blog/p/8434811.html
A1032
https://www.cnblogs.com/zhuqiwei-blog/p/8531037.html
A1033*
https://www.cnblogs.com/zhuqiwei-blog/p/8502536.html
A1034*
https://www.cnblogs.com/zhuqiwei-blog/p/8546815.html
1、不要忘记按名字的字典序输出。
A1035
https://www.cnblogs.com/zhuqiwei-blog/p/8442566.html
A1036
https://www.cnblogs.com/zhuqiwei-blog/p/8433466.html
A1037
https://www.cnblogs.com/zhuqiwei-blog/p/8502903.html
A1038*
https://www.cnblogs.com/zhuqiwei-blog/p/8503463.html
A1039*
https://www.cnblogs.com/zhuqiwei-blog/p/8523474.html
A1040*
http://www.cnblogs.com/zhuqiwei-blog/p/8563645.html
A1041
https://www.cnblogs.com/zhuqiwei-blog/p/8495463.html
A1042
https://www.cnblogs.com/zhuqiwei-blog/p/8428441.html
A1043*
https://www.cnblogs.com/zhuqiwei-blog/p/8542725.html
A1044*
https://www.cnblogs.com/zhuqiwei-blog/p/8511952.htm
https://www.cnblogs.com/zhuqiwei-blog/p/8428638.html
A1047
https://www.cnblogs.com/zhuqiwei-blog/p/8524644.html
A1048
https://www.cnblogs.com/zhuqiwei-blog/p/8496217.html
A1049*
https://www.cnblogs.com/zhuqiwei-blog/p/8516492.html
A1050
https://www.cnblogs.com/zhuqiwei-blog/p/8495978.html
1、现已不支持gets()函数。使用时用getline(cin, ss)和string代替。
A1051*
https://www.cnblogs.com/zhuqiwei-blog/p/8530271.html
A1052*
https://www.cnblogs.com/zhuqiwei-blog/p/8531310.html
1、第一遍遍历时采取静态链表的方式存储。第二次排序后的遍历时,直接顺序遍历即可。
A1053*
https://www.cnblogs.com/zhuqiwei-blog/p/8540633.html
1、数的存储:静态数或者链表树。
A1054*
https://www.cnblogs.com/zhuqiwei-blog/p/8526118.html
1、map迭代使用it->first, it->second;
A1055*
https://www.cnblogs.com/zhuqiwei-blog/p/8491779.html
A1056*
https://www.cnblogs.com/zhuqiwei-blog/p/8530722.html
1、栈的应用。
A1057*
https://www.cnblogs.com/zhuqiwei-blog/p/8564361.html
A1058
https://www.cnblogs.com/zhuqiwei-blog/p/8439243.html
A1059*
https://www.cnblogs.com/zhuqiwei-blog/p/8521898.html
A1060*
https://www.cnblogs.com/zhuqiwei-blog/p/8525536.html
A1061*
https://www.cnblogs.com/zhuqiwei-blog/p/8439556.html
A1062
https://www.cnblogs.com/zhuqiwei-blog/p/9436760.html
A1063*
https://www.cnblogs.com/zhuqiwei-blog/p/8524856.html
A1064*
https://www.cnblogs.com/zhuqiwei-blog/p/8542835.html
A1065
https://www.cnblogs.com/zhuqiwei-blog/p/8430762.html
A1066*
https://www.cnblogs.com/zhuqiwei-blog/p/8544201.html
A1067*
https://www.cnblogs.com/zhuqiwei-blog/p/8503246.html
A1069*
https://www.cnblogs.com/zhuqiwei-blog/p/8514431.html
A1070
https://www.cnblogs.com/zhuqiwei-blog/p/8496671.html
A1071
https://www.cnblogs.com/zhuqiwei-blog/p/8526199.html
A1072*
https://www.cnblogs.com/zhuqiwei-blog/p/8562515.html
A1073*
https://www.cnblogs.com/zhuqiwei-blog/p/8441588.html
A1074*
https://www.cnblogs.com/zhuqiwei-blog/p/8531585.html
A1075*
https://www.cnblogs.com/zhuqiwei-blog/p/8492756.html
A1076*
https://www.cnblogs.com/zhuqiwei-blog/p/8548445.html
A1077
https://www.cnblogs.com/zhuqiwei-blog/p/8442855.html
A1078
https://www.cnblogs.com/zhuqiwei-blog/p/8519994.html
A1079
https://www.cnblogs.com/zhuqiwei-blog/p/8541682.html
A1080*
https://www.cnblogs.com/zhuqiwei-blog/p/8494030.html
A1081*
https://www.cnblogs.com/zhuqiwei-blog/p/8516710.html
A1082*
https://www.cnblogs.com/zhuqiwei-blog/p/8443504.html
A1083
https://www.cnblogs.com/zhuqiwei-blog/p/8492963.html
A1084
https://www.cnblogs.com/zhuqiwei-blog/p/8495338.html
A1085*
https://www.cnblogs.com/zhuqiwei-blog/p/8510549.html
A1086*
https://www.cnblogs.com/zhuqiwei-blog/p/8538979.html
A1087*
https://www.cnblogs.com/zhuqiwei-blog/p/8563330.html
A1088*
https://www.cnblogs.com/zhuqiwei-blog/p/9473322.html
A1089*
https://www.cnblogs.com/zhuqiwei-blog/p/8513863.html
A1090
https://www.cnblogs.com/zhuqiwei-blog/p/8541927.html
A1091*
https://www.cnblogs.com/zhuqiwei-blog/p/8537069.html
A1092
https://www.cnblogs.com/zhuqiwei-blog/p/8495410.html
A1093*
https://www.cnblogs.com/zhuqiwei-blog/p/8514066.html
A1094
https://www.cnblogs.com/zhuqiwei-blog/p/9485351.html
A1095*
https://www.cnblogs.com/zhuqiwei-blog/p/8495217.html
A1096*
https://www.cnblogs.com/zhuqiwei-blog/p/8520149.html
A1097
https://www.cnblogs.com/zhuqiwei-blog/p/8531703.html
A1098*
https://www.cnblogs.com/zhuqiwei-blog/p/8545315.html
A1099*
https://www.cnblogs.com/zhuqiwei-blog/p/8542889.html
A1100*
https://www.cnblogs.com/zhuqiwei-blog/p/8526079.html
A1101*
https://www.cnblogs.com/zhuqiwei-blog/p/8514230.html
A1102*
https://www.cnblogs.com/zhuqiwei-blog/p/8540207.html
A1103**
https://www.cnblogs.com/zhuqiwei-blog/p/8536891.html
A1104*
https://www.cnblogs.com/zhuqiwei-blog/p/8515274.html
A1105*
https://www.cnblogs.com/zhuqiwei-blog/p/8564390.html
A1106
https://www.cnblogs.com/zhuqiwei-blog/p/8542116.html
A1107*
https://www.cnblogs.com/zhuqiwei-blog/p/8544565.html
A1108*
https://www.cnblogs.com/zhuqiwei-blog/p/8570467.html
A1109*
https://www.cnblogs.com/zhuqiwei-blog/p/8572853.html
A1110
https://www.cnblogs.com/zhuqiwei-blog/p/8573370.html
A1111*
https://www.cnblogs.com/zhuqiwei-blog/p/8574215.html
A1112*
https://www.cnblogs.com/zhuqiwei-blog/p/8574855.html
A1113
https://www.cnblogs.com/zhuqiwei-blog/p/8574972.html
A1114*
https://www.cnblogs.com/zhuqiwei-blog/p/8576568.html
A1115*
https://www.cnblogs.com/zhuqiwei-blog/p/8576760.html
A1116
https://www.cnblogs.com/zhuqiwei-blog/p/8576886.html
A1117*
https://www.cnblogs.com/zhuqiwei-blog/p/8577041.html
A1118*
https://www.cnblogs.com/zhuqiwei-blog/p/8577165.html
A1119*
https://www.cnblogs.com/zhuqiwei-blog/p/8577706.html
A1120
https://www.cnblogs.com/zhuqiwei-blog/p/8577717.html
A1121
https://www.cnblogs.com/zhuqiwei-blog/p/8577725.html
A1122*
https://www.cnblogs.com/zhuqiwei-blog/p/8580406.html
A1123*
https://www.cnblogs.com/zhuqiwei-blog/p/8582635.html
A1124
https://www.cnblogs.com/zhuqiwei-blog/p/8582983.html
A1125
https://www.cnblogs.com/zhuqiwei-blog/p/8583083.html
A1126*
https://www.cnblogs.com/zhuqiwei-blog/p/8583781.html
A1127
https://www.cnblogs.com/zhuqiwei-blog/p/8584675.html
A1128
https://www.cnblogs.com/zhuqiwei-blog/p/8586009.html
A1129**
https://www.cnblogs.com/zhuqiwei-blog/p/8586545.html
A1130*
https://www.cnblogs.com/zhuqiwei-blog/p/8586916.html
A1131*
https://www.cnblogs.com/zhuqiwei-blog/p/8589584.html
A1132
https://www.cnblogs.com/zhuqiwei-blog/p/9553694.html
A1133*
https://www.cnblogs.com/zhuqiwei-blog/p/9553756.html
A1134*
https://www.cnblogs.com/zhuqiwei-blog/p/9553806.html
A1135*
https://www.cnblogs.com/zhuqiwei-blog/p/9553889.html
A1136*
https://www.cnblogs.com/zhuqiwei-blog/p/9560088.html
A1137
https://www.cnblogs.com/zhuqiwei-blog/p/9560169.html
A1138
https://www.cnblogs.com/zhuqiwei-blog/p/9560200.html
A1139*
https://www.cnblogs.com/zhuqiwei-blog/p/9560712.html
A1140*
https://www.cnblogs.com/zhuqiwei-blog/p/9566605.html
A1141
https://www.cnblogs.com/zhuqiwei-blog/p/9566623.html
A1142*
https://www.cnblogs.com/zhuqiwei-blog/p/9566681.html
A1143*
https://www.cnblogs.com/zhuqiwei-blog/p/9567064.html
A1144
https://www.cnblogs.com/zhuqiwei-blog/p/9569683.html
A1145*
https://www.cnblogs.com/zhuqiwei-blog/p/9569736.html
A1146
https://www.cnblogs.com/zhuqiwei-blog/p/9569768.html
A1147