/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Time Exceeded ≥1096ms ≥512.0 KiB
#3 Time Exceeded ≥1094ms ≥540.0 KiB
#4 Time Exceeded ≥1097ms ≥540.0 KiB

Code

   #include<bits/stdc++.h>
	using namespace std;
	#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL)
	#define endl '\n'
	#define ll long long
	#define test_case int t;cin>>t;while(t--)

	 
	    //const int mx=2e5+123;
	   // long long dp[mx];

	

	int fun(int n){
		
		if(n==0) return 0;
		if(n<0) return 1e9;

		int m1,m2;

		m1=fun(n-2)+1;
		m2=fun(n-3)+1;

		return min(m1,m2);

	}

	

int main(){
	 
			FAST_IO;

			int n;

			cin>>n;

			cout<<fun(n);



}			

			 




		
			






Information

Submit By
Type
Submission
Problem
P1106 too easy or three easy
Contest
Brain Booster #6
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 15:41:04
Judged At
2024-10-03 15:41:04
Judged By
Score
10
Total Time
≥1097ms
Peak Memory
≥540.0 KiB