最近太忙太忙,只能抽时间写几道简单题。不过我倒是明白要想水平提高不看题解是最好的了。 A 我只能死找规律了,无法证明 int a[50002][2] ;vector< vector<int> > gmax , gmin ;int main(){int n , i , j , k , cmax , cmin ;while(cin>>n){/* g
题意:给你n个值,要求将其划分成m部分(顺序不能打乱),如何划分使得最大部分的值最小。 题解:二分,对于每一个中间值,检测一次。 #include<cstdio>int N, M;int spend[200000];bool check ( int num ){int i, sum, cnt = 0;for ( i = 0; i < N; ){sum = 0; cnt++;w
Little Sub is about to take a math exam at school. As he is very confident, he believes there is no need for a review. Little Sub’s father, Mr.Potato, is nervous about Little Sub’s attitude, so he gi
A Easy Number Game 贪心 很容易想到,将数列排序 将前2n个数 掐头去尾的相乘求和 #include<iostream>#include<cstring>#include<algorithm>using namespace std;int T;int n,m;int s[100100];int main(){cin>>T;while(T--){cin>>n>>
EOJ Monthly 2020.9 Sponsored by TuSimple B. 健康监测计划 题目链接 规律题~ 对于 k k k 为偶数的时候,就是取 k 2 \frac{k}{2} 2k 次叶子(一次是指取当前图中的所有叶子结点,且每取一次叶子结点都要删去),当 k k k 为奇数的时候,多取一个结点,AC代码如下: #include <bits/stdc++.h>us
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 mone