76902024-01-10 13:21:07szabelrBimmbamm (30)cpp17Hibás válasz 18/303ms3708 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, hol = 1, rossz=0,cucc=1;
    cin >> n;
    string x;
    for (int i = 1; i <= n and cucc==1; i++) {
        cin >> x;
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BIMM" and cucc==1)
        {
            cout << i;
            cucc = 0;
        }
        
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 != 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 != 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 == 0 and x == "BIMM" and cucc == 1)
        {
            cout << rossz;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 == 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 == 0 and x == "BIMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 == 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        hol++;
    }
    //cout << rossz - 1;
    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base18/30
1Elfogadva0/03ms1808 KiB
2Elfogadva0/03ms2060 KiB
3Elfogadva3/33ms2276 KiB
4Elfogadva3/33ms2332 KiB
5Elfogadva3/33ms2524 KiB
6Hibás válasz0/33ms2740 KiB
7Hibás válasz0/33ms2948 KiB
8Elfogadva3/33ms3200 KiB
9Hibás válasz0/33ms3412 KiB
10Elfogadva3/33ms3460 KiB
11Hibás válasz0/33ms3708 KiB
12Elfogadva3/33ms3696 KiB