Submission #154527

#TimeUsernameProblemLanguageResultExecution timeMemory
154527phillipSan (COCI17_san)C++14
48 / 120
1074 ms376 KiB
#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 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...