A. Add and Divide
1485A
本题貌似没有什么特别的好方法,直接暴力。
为了使每次除得到最大价值,那么应该先加再除。(贪心思想)
ac代码:
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <string.h>
#include <map>
#include <stdlib.h>
#include <time.h>
#define MAX_N 1e8+7
#define ll long long
using namespace std;
int find_the_div(ll a,ll b)
{
int ans=0;
while(a!=0){
ans++;
a/=b;
}
return ans;