23382023-01-10 15:29:28Tibi23Bimmbamm (30)cpp11Accepted 30/303ms3364 KiB
#include <iostream>

using namespace std;

int main()
{
  int N;
  cin>>N;
  string szo;

  for(int i=1; i <= N; i++){
    cin>>szo;

    if (i%15 == 0){
        if( szo != "BUMM"){
            cout<<i;
            return 0;
        }
        continue;
    }
    if(i%3 == 0 ){
          if(szo != "BIMM"){
            cout<<i;
            return 0;
          }
          continue;
    }
    if(i%5 == 0 ){
        if(szo != "BAMM"){
            cout<<i;
            return 0;
        }
        continue;
    }
    if(i%3 != 0 && i%5 != 0 &&szo != "SZAM"){
            cout<<i;
            return 0;
    }


  }

    cout<<0;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1680 KiB
2Accepted0/02ms1932 KiB
3Accepted3/32ms2048 KiB
4Accepted3/32ms2124 KiB
5Accepted3/32ms2260 KiB
6Accepted3/32ms2436 KiB
7Accepted3/32ms2516 KiB
8Accepted3/32ms2760 KiB
9Accepted3/32ms2764 KiB
10Accepted3/32ms3000 KiB
11Accepted3/32ms3168 KiB
12Accepted3/32ms3364 KiB