제출 #1218223

#제출 시각아이디문제언어결과실행 시간메모리
1218223cpismayilmmdv985Topical (NOI23_topical)C++20
12 / 100
2 ms328 KiB
#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    
    int N, K;   cin >> N >> K;
    vector<array<int, 2>> A(N); 
    for (auto &a : A)   cin >> a[0];
    for (auto &a : A)   cin >> a[1];
    sort(A.begin(), A.end());
    int P = 0, cnt = 0;
    for (auto &a : A) {
        if (a[0] > P) 
            break;
        P += a[1];
        cnt++;
    }
    cout << cnt;

    return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…