原创 洛谷 P1175 表達式的轉換

https://www.luogu.com.cn/problem/P1175 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #include<bits/stdc++.h> 3 usi

原创 先序遍歷加中序遍歷確定後序遍歷

1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0) 3 #include <bits/stdc++.h> 4 u

原创 中序遍歷加後序遍歷確定先序遍歷

https://www.luogu.com.cn/problem/P1030 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_st

原创 PIPIOJ 1025: 最短距離(三分)

http://www.pipioj.online/problem.php?id=1025 顯然,兩個人的距離要麼越來越遠,要麼先越來越近再越來越遠,故對時間三分即可求出最短距離。 1 #define bug(x) cout<<#x<<"

原创 hihocoder #1338 : A Game(區間dp)

http://hihocoder.com/problemset/problem/1338 區間dp。 d[l][r]表示[l,r]區間先手取能得到的最大分數。 1 #define bug(x) cout<<#x<<" is "<<x<<

原创 UVA1438 Asteroids(增量法求三維凸包,加權所有三棱錐質量求多面體重心)

https://www.luogu.com.cn/problem/UVA1438 題解建議參考lrj白書。 代碼來自牛逼網友。 我只是存個板子。 1 #include <cstdio> 2 #include <cstring>

原创 UVA1469 Ardenia(三維幾何,分數類)

https://www.luogu.com.cn/problem/UVA1469 求空間兩條線段距離,三維幾何入門,存板子 1 #define IO std::ios::sync_with_stdio(0) 2 #include

原创 UVA11275 3D Triangles(三維幾何)

https://www.luogu.com.cn/problem/UVA11275 三維入門入門,貼個板子。 1 #define IO std::ios::sync_with_stdio(0) 2 #include <bits/s

原创 2019長沙學院新生賽 B,G題解

  B https://ac.nowcoder.com/acm/contest/2891/B 題解 簡單貪心題。 對數組排序,每三個組成一組求出差值之後取最大值就是答案。 1 #include<bits/stdc++.h> 2 usi

原创 2017-2018 ACM-ICPC Northern Eurasia (Northeastern European Regional) Contest (NEERC 17)(B,D)

https://codeforces.com/gym/101630/attachments B - Box 根據樣例可以得出幾個式子,具體看代碼,只要滿足其中之一就可以 1 #include<bits/stdc++.h> 2 usi

原创 2016湖南省省賽 B 有向無環圖(樹形dp)

d[u]表示u到其他所有點的路徑數*對應點的權值的和 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0) 3

原创 2016湖南省省賽 J 三角形和矩形(計算幾何)

https://ac.nowcoder.com/acm/contest/1112/J 把三角形的頂點裏在矩形裏面的點放進數組; 把矩形的頂點裏在三角形裏面的點放進數組; 把三角形三條邊和矩形四條邊的交點放進數組(規範相交); 對這個數組去重

原创 JAVA 高精度小數模板

1 package 實驗; 2 import java.math.BigDecimal; 3 import java.math.BigInteger; 4 import java.math.MathContext; 5

原创 2019湖南省賽 K 雙向鏈表練習題(list)

https://ac.nowcoder.com/acm/contest/1099/K 這題大概只要會list就會做吧。。。我是真的dd 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #de

原创 2019 字節跳動 [編程題]最大映射(貪心)

https://www.nowcoder.com/question/next?pid=1649268&qid=44705&tid=28244198 對每一種字母設定一個權值v,權值越大說明應該置爲越大的數,然後按權值排序。 d[i]表示字母