Submission #1026002

#TimeUsernameProblemLanguageResultExecution timeMemory
1026002vjudge1San (COCI17_san)C++17
48 / 120
52 ms348 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; ll k; cin >> n >> k; ll h[n], x[n]; for(int i = 0; i < n; i ++) cin >> h[i] >> x[i]; int ans = 0; for(int mask = 0; mask < (1 << n); mask++) { ll sm = 0; int prv = 0; for(int i = 0; i < n; i ++) { if((1 << i) & mask) { if(prv > h[i]) { sm = 0; break; } sm += x[i]; prv = h[i]; } } if(sm >= k) ans++; } cout << ans << endl; return 0; }
#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...