제출 #1297473

#제출 시각아이디문제언어결과실행 시간메모리
1297473samarthkulkarniTopical (NOI23_topical)C++20
33 / 100
223 ms15944 KiB
// noi 2023 final round #include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<long long> #define all(x) x.begin(), x.end() #define endl "\n" #define pr pair<ll, ll> #define ff first #define ss second void solution(); int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); solution(); return 0; } void solution() { ll n, k; cin >> n >> k; vector<pr> a(n); for (int i = 0; i < n; i++) cin >> a[i].ff; for (int i = 0; i < n; i++) cin >> a[i].ss; ll x = 0; sort(all(a)); int i = 0; for (; i < n; i++) { if (x < a[i].ff) break; x += a[i].ss; } cout << i << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...