Code
// Problem Solver: Mushfiq R.
#include <iostream>
using namespace std;
#define ll long long
#define ld long double
#define vsort(v) sort(v.begin(), v.end())
int minOperation(int n)
{
if (n <= 0)
{
return 0;
}
return 1 + min(minOperation(n - 2), minOperation(n - 3));
}
int main()
{
int n;
cin >> n;
int echo = minOperation(n);
cout << echo << endl;
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1106 too easy or three easy
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-10-03 16:10:49
- Judged At
- 2024-11-11 02:49:07
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB