59662023-10-06 20:34:50horvathabelRadar (70 pont)cpp17Wrong answer 15/70107ms7020 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;

    vector<int> ownRadar(n);
    vector<int> enemyRadar(m);

    for (int i = 0; i < n; i++) {
        cin >> ownRadar[i];
    }

    for (int i = 0; i < m; i++) {
        cin >> enemyRadar[i];
    }

    sort(ownRadar.begin(), ownRadar.end());

    bool ableToDetect = true;
    int ownIdx = 0, enemyIdx = 0;
    vector<pair<int, int>> unableToDetectPairs;

    while (ownIdx < n && enemyIdx < m) {
        if (ownRadar[ownIdx] >= enemyRadar[enemyIdx]) {
            unableToDetectPairs.push_back({ownIdx + 1, enemyIdx + 1});
            enemyIdx++;
        } else {
            ownIdx++;
        }
    }

    if (enemyIdx < m) {
        ableToDetect = false;
    }

    if (ableToDetect) {
        cout << "IGEN" << endl;
    } else {
        cout << "NEM" << endl;
        cout << unableToDetectPairs[0].first << " " << unableToDetectPairs[0].second << endl;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/70
1Wrong answer0/03ms1680 KiB
2Accepted0/03ms1928 KiB
3Wrong answer0/52ms2012 KiB
4Wrong answer0/53ms2180 KiB
5Wrong answer0/52ms2144 KiB
6Runtime error0/53ms2500 KiB
7Wrong answer0/53ms2672 KiB
8Wrong answer0/53ms2644 KiB
9Wrong answer0/53ms2872 KiB
10Accepted5/541ms6528 KiB
11Wrong answer0/541ms6732 KiB
12Accepted5/556ms4636 KiB
13Wrong answer0/563ms4476 KiB
14Accepted5/5105ms5788 KiB
15Wrong answer0/5107ms6936 KiB
16Wrong answer0/5107ms7020 KiB