# LeetCode 1553. Minimum Number of Days to Eat N Oranges

```class Solution {
public:
map<int,int> dp;
int minDays(int n)
{
if (n <= 2)
return n;
if(dp[n]==0)
{
dp[n]= 1 + min(n % 2 + minDays(n / 2), n % 3 + minDays(n / 3));
}

return dp[n];
}
};```

0 条评论

• ### LeetCode笔记：Weekly Contest 202 比赛记录

我们考察达到最终结果时的状态，由于原始态的向量为：[1,3,5,...,2n−1]，故达到平衡态时，所有的元素变为：[n,n,n,...,n]，因此，每一个元素...

• ### 【Oracle】-【AWR/Stackpack】-AWR(Stackpack)执行权限

Oracle 9i执行Stackpack(10g是AWR)，当前是一个普通账户，没有DBA权限。

• ### LeetCode Weekly Contest 32解题思路

版权声明：本文为博主原创文章，未经博主允许不得转载。 https://blog.csdn.n...

• ### CodeForces 732B Cormen — The Best Friend Of a Man

B. Cormen — The Best Friend Of a Man time limit per test 1 second memory lim...

• ### CodeForces 732D Exams

D. Exams time limit per test 1 second memory limit per test 256 megabytes ...

• ### Codeforces 839A Arya and Bran【暴力】

A. Arya and Bran time limit per test:1 second memory limit per test:256 megabyte...

• ### Minimum Cost For Tickets

In a country popular for train travel, you have planned some train travelling on...

• ### CF--思维练习--CodeForces - 216C - Hiring Staff （思维+模拟）

ACM思维题训练集合 A new Berland businessman Vitaly is going to open a household applia...

• ### ZOJ 3498 Javabeans

Javabeans Time Limit: 2 Seconds Memory Limit: 65536 KB Javabeans are de...

• ### 2018-2019 ICPC, NEERC, Southern Subregional Contest D. Garbage Disposal

Enough is enough. Too many times it happened that Vasya forgot to dispose of gar...

• ### CF思维联系– CodeForces - 991C Candies(二分)

After passing a test, Vasya got himself a box of n candies. He decided to eat an...

• ### Codeforces 789A Anastasia and pebbles(数学，思维题)

A. Anastasia and pebbles time limit per test:1 second memory limit per test:256 ...

• ### LightOJ 1203--Guarding Bananas(二维凸包+内角计算)

Once there was a lazy monkey in a forest. But he loved banana too much. One day ...

• ### LeetCode Weekly Contest 38解题思路

版权声明：本文为博主原创文章，未经博主允许不得转载。 https://blog.csdn.n...

• ### LeetCode Weekly Contest 43解题思路

版权声明：本文为博主原创文章，未经博主允许不得转载。 https://blog.csdn.n...

• ### 一行代码修改Linux机器密码和Samba服务密码

当我们需要用命令代替我们往Linux窗口输入东西时，可以考虑使用Linux文件描述符里的标准输入，而passwd、smbpasswd命令均有自己对应的标准输入参...

• ### 关关的刷题日记82 – Leetcode 453. Minimum Moves to Equal Array Elements

关关的刷题日记82 – Leetcode 453. Minimum Moves to Equal Array Elements 题目 Given a non-e...

Overview of the Automatic Workload Repository

• ### POJ 3273 Monthly Expense

Monthly Expense Time Limit: 2000MS Memory Limit: 65536K Total Submissions: ...