hackerrank
turbozzz
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Hacker Rank: Magic Square Diff
From 1 - 9 , sum is 45. each Line and each Row 15The 8 valid combinations of 3 numbers that add to 15 are:9 5 17 5 32 5 84 5 62 9 46 1 86 7 28 3 4All 8 of those combinations need to appear ...原创 2020-04-12 23:10:47 · 210 阅读 · 0 评论 -
HackerRank: Extraordinary long factorial
思路: 用vector保存结果的每一位代码:void extraLongFactorials(int n) { if (n == 1) { cout << 1 << endl; return; } vector<int> digits(1, 1); for (int curr(2); curr...原创 2020-04-12 20:16:54 · 184 阅读 · 0 评论 -
HackerRank: Non-Divisible Subset
考虑事项:remainder[k/2] = 1remainder[0] 里面只能抽出一个即 remainder[0] = std::min(remainder[0], 1)and remainder[k/2] = std::min(remainder[k/2], 1) when k%2 == 0.计算for (int i = 0; i<=k/2, i++) maxRes ...原创 2020-04-12 16:33:45 · 503 阅读 · 0 评论
分享