This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int ans;
long long k;
void ed(long long sum)
{
if(sum>=k)ans++;
}
int n;
long long h[49],g[49];
void bt(int x,long long sum)
{
sum+=g[x];
ed(sum);
for(int i=x+1;i<n;i++)
{
if(h[i]>=h[x])
{
bt(i,sum);
}
}
}
int main()
{
cin>>n>>k;
for(int i=0;i<n;i++)cin>>h[i]>>g[i];
for(int i=0;i<n;i++)
{
bt(i,0);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |