Submission #154526

#TimeUsernameProblemLanguageResultExecution timeMemory
154526phillipSan (COCI17_san)C++14
0 / 120
1077 ms380 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...