原创 P1055 ISBN號碼

https://www.luogu.com.cn/problem/P1055 最開始在mod11爲10時,最後一位識別碼爲X,這一點沒有注意到,導致WA,修改後就滿分 #include<iostream> using nam

原创 P1008 三連擊 巧妙的循環輸出

https://www.luogu.com.cn/problem/P1008 最開始需要確定a的浮動區間,因爲a,b,c無論如何都存在1:2:3的比例,最小值當然是123,但是我在最初確定最大值的視乎以爲是321,但是實際上卻是

原创 P2669 金幣

https://www.luogu.com.cn/problem/P2669 it迭代不能>=n,因爲it此時已經遞增了,數據有可能會卡邊 #include<iostream> using namespace std; in

原创 P5705 【深基2.例7】數字反轉

https://www.luogu.com.cn/problem/P5705 使用字符串,從最後往前輸出 #include<iostream> using namespace std; int main() { st

原创 P2955 [USACO09OCT]奇數偶數Even? Odd?

https://www.luogu.com.cn/problem/P2955 #include<iostream> using namespace std; int main() { int n,s;cin >> n;

原创 P1739 表達式括號匹配

文章目錄大佬do...while循環更好 https://www.luogu.com.cn/problem/P1739 #include<iostream> #include<cstdio> using namespace st

原创 P5715 【深基3.例8】三位數排序

#include<iostream> #include<algorithm> using namespace std; int main() { int x[3]; cin >> x[0] >> x[1] >>

原创 P1146 硬幣翻轉

文章目錄大佬位運算 https://www.luogu.com.cn/problem/P1146 對於n個硬幣來說,每次翻動n-1個就是每次翻動1個,所以操作數會有n個 a[j] = a[j] ? 0 : 1;一條語句翻硬幣

原创 P1909 買鉛筆

總是有WA的點 #include<iostream> #include<cmath> using namespace std; long long n,a[7],b[4],m = 10000000; int main() {

原创 【哈佛積極心理學】【5】環境的力量

文章目錄積極情緒是雙贏的追求幸福是不是一種自私的行爲“自私”是人性的美妙之處成爲你在世界上想見到的改變傳播快樂的最佳方法就是爭取自己的快樂別給自己設限 我曾深信環境對人發展的影響,只是沒有想到會有如此之大。 積極情緒是雙贏的 積極

原创 P6056 [加油武漢]SIR 模型

https://www.luogu.com.cn/problem/P6056 這個題太麻煩了 不知道出題人希望我們結算的順序是什麼,反正只過了三個點。 #include<iostream> #include<cmath> u

原创 P1028 數的計算

https://www.luogu.com.cn/problem/P1028 這不是一個暴力題,如果暴力來做會TLE,所以需要找出規律遞歸 #include<iostream> #include<cmath> using n

原创 P1149 火柴棒等式 (DFS)

https://www.luogu.com.cn/problem/P1149 起初以爲這個題需要dfs,但是其實只需要一個2000x2000的循環就可以枚舉出全部答案。 忘記了0需要特判一下 #include<iostrea

原创 P1548 棋盤問題

https://www.luogu.com.cn/problem/P1548 這個題最開始想找公式,沒找到,最後發現需要使用暴力枚舉 #include<iostream> using namespace std; int s

原创 P5728 【深基5.例5】旗鼓相當的對手

二維數組進行記錄,二重循環不重不漏 #include<iostream> #include<cmath> using namespace std; int s[1001][4],tot; int main() { i