题意 给你一个,需要将其变为,每次操作可以选择对减一花费元,或对除以花费元,求将变为的最小花费。 题解 如果当前,只能执行次第一种操作,然后答案加。 如果当前不能被整除,那肯定只能执行第一种操作,次。也就是,然后答案加。 如果能被整除,则判断从到那种操作花费更小,设,判断是和哪个小 复杂度 时间复杂度 代码 #include<bits/stdc++.h> using namespace std; int main() { int t; scanf("%d",&t); while(t--) { int n,k,x,y; scanf("%d%d...