Monthly Expense Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14158 Accepted: 5697 Description Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and r…
POJ 3273 Monthly Expense二分查找(最大值最小化问题) 题目:Monthly Expense Description Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ mon…
Monthly Expense Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 36628 Accepted: 13620 Description Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and reco…
//最大值最小 //天数的a[i]值是固定的 不能改变顺序 # include <algorithm> # include <string.h> # include <stdio.h> using namespace std; int n,m; int a[100010]; int judge(int x) { int ans=1;//分成了几组 int tmp=0; for(int i=0;i<n;i++) { tmp+=a[i]; if(tmp>x) {…