随笔分类 - 数学——二、三分法
摘要:题目链接:http://codeforces.com/problemset/problem/348/A代码:#include#include#include#includeusing namespace std;int main(){ //freopen("E:\\acm\\input.txt","r",stdin); int n; scanf("%d",&n); long long L,R; L = R = 0; for(int i=1; i<=n; i++) { long long a; scanf("%I
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4768算法思路:最核心的就是找到前n个人的传单数总和可以二分。代码:#include#include#include#includeusing namespace std;const int maxn = 20002;long long A[maxn],B[maxn],C[maxn];int N;int main(){ //freopen("E:\\acm\\input.txt","r",stdin); while(cin>>N) { long l
阅读全文