一二三四五 上山打老虎

摘要: 链接:https://www.acwing.com/problem/content/description/3420/ 思路: 1:通过分析题目,本题是一个三进制枚举后取正整数的题目,如果直接dfs进行枚举,则时间复杂度为O(3^n),n<=100,时间复杂度不满足条件,但是题目中强调N个砝码总重不 阅读全文
posted @ 2021-05-01 12:02 黒川川 阅读(280) 评论(0) 推荐(0)
摘要: 链接:https://www.acwing.com/problem/content/3419/ 代码: #include<bits/stdc++.h> #define intl long long using namespace std; int main (){ intl num; cin>>nu 阅读全文
posted @ 2021-05-01 10:28 黒川川 阅读(339) 评论(0) 推荐(0)