- 2018.07.31
- Binary Search(二分搜尋), poj, 三角形poj, 二分, 保研機試poj,
[二分] [POJ] 2456 Aggressive cows
網上都是二分搜尋答案 其實過程也可以二分搜尋 洛谷有個扔瓶蓋 一樣的 #include <iostream> #include <algorithm> using namespace std; const int MAXN = 1e5 50; int cow[MAXN] = […]
-->
程式前沿 幫助程式設計師解決問題,增加專業技能,提升個人能力與未來世界競爭力。
網上都是二分搜尋答案 其實過程也可以二分搜尋 洛谷有個扔瓶蓋 一樣的 #include <iostream> #include <algorithm> using namespace std; const int MAXN = 1e5 50; int cow[MAXN] = […]
水題 #include <iostream> #include <algorithm> using namespace std; const int MAXN = 1e5; int arr[MAXN]; int ans = 0; int N, M; bool find(int […]
最早的想法是推公式 愣是沒推出來 菜逼只能暴力字首和加二分 字首和不用算完 由題意算到一半多點就可以了 二分的時候要注意邊界 #include <iostream> using namespace std; const int MAXN = 2e6 10; typedef long lo […]
P3383 線性篩素數 #include <iostream> using namespace std; const int MAXN = 1e7 10; int check[MAXN] = {0}; int prime[MAXN] = {0}; int pos = 0; int fla […]