# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
473214 |
2021-09-15T10:26:06 Z |
Ahmed_Solyman |
San (COCI17_san) |
C++14 |
|
1000 ms |
204 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,k;
ll dp[45][45];
vector<ll>a(45),b(45);
ll solve(ll i,ll prev,ll sum){
if(i==n)return 0;
ll Take=0;
ll notTake=solve(i+1,prev,sum);
if(a[i]>=a[prev]){
Take=solve(i+1,i,sum+b[i])+(sum+b[i]>=k);
}
return Take+notTake;
}
int main()
{
memset(dp,-1,sizeof(dp));
cin>>n>>k;
for(ll i=0;i<n;i++)cin>>a[i]>>b[i];
cout<<solve(0,44,0)<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1085 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1083 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1088 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |