181962025-10-13 09:54:29szabelrBimmbamm (30)cpp17Accepted 30/301ms500 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,r,v=0;
    string x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(i%3!=0 and i%5!=0 and x!="SZAM" and v==0){
            r=i;
            v=1;
        }
        if(i%3==0 and i%5==0 and x!="BUMM" and v==0){
            r=i;
            v=1;
        }
        if(i%3==0 and i%5!=0 and i%15!=0 and x!="BIMM" and v==0){
            r=i;
            v=1;
        }
        if(i%3!=0 and i%5==0 and i%15!=0 and x!="BAMM" and v==0){
            r=i;
            v=1;
        }
    }
    cout<<r;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms316 KiB
2Accepted0/01ms500 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms500 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Accepted3/31ms316 KiB