Submission #1089122

#TimeUsernameProblemLanguageResultExecution timeMemory
1089122vjudge1Bank (IZhO14_bank)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #define int long long #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz size() #define yes "YES" #define no "NO" #define IOI ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define pf push_front #define pb push_back #define S second #define F first using namespace std; const int N = 5000 + 5; const int NN = 20; const int mod = (1e9 + 7); const int inf = 1e18; void legenda_ne_umret(){ int n, m; cin >> n >> m; int x; cin >> x; int a[m + 4]; for (int i = 1; i <= m; i++) { cin >> a[i]; } sort(a + 1,a + m + 1); for (int i = m; i >= 1; i--) { if (a[i] <= x) x-= a[i]; } if (!x) cout << yes; else cout << no; } signed main() { IOI; // freopen("maze.in", "r", stdin); // freopen("maze.out", "w", stdout); ///////////////////////////////////////////// int t = 1; // cin >> t; for (int i = 1; i <= t; i++) { // cout << "Case " << i << ":\n"; legenda_ne_umret(); // cout << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...