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,k;
void ed(int sum)
{
if(sum>=k)ans++;
}
int h[49],g[49],n;
void bt(int x,int 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... |