Loading [MathJax]/jax/output/HTML-CSS/config.js

标签: 枚举

3 篇文章

凑平方
Original Link 思想: 贪心,枚举。 对于满足条件最大的数,我们枚举其因子 ii: 保证 iin\sqrt{n} 开始递减枚举; 得到 st=i×ist = i \times i,判断 stst 是否可由删除 nn 的某些位得到。 若首次找到符合条件的数,即为所求; 否则,直到 $…
金币
Original Link 思想: 模拟。 根据题意,设置变量 cnt 和 day 分别代表当天能收到的金币数和收到 cnt 金币的天数。 循环枚举第 i 天,每次循环: 若当天 cnt == day 说明金币需要增加 cnt ++,且要重置 day = 0。 总共收到的金币 sum += cnt;…
比例简化
Original Link 思想1: 暴力枚举。 枚举分子 i 和分母 j,利用 eps 作为差值的最小值来判断更新条件。 代码: #include <bits/stdc++.h> using namespace std; void solve(){ double a, b; int L…

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-content/themes/argon-theme-featured/inc/fun/paginate.php on line 22

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-content/themes/argon-theme-featured/inc/fun/paginate.php on line 22