114492024-09-26 08:28:18tKriszBimmbamm (30)cpp14Accepted 30/303ms504 KiB
#include <iostream>

using namespace std;

int main()
{
    char a,b;
    int n;
    bool van=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>b>>a>>b>>b;
        if(a=='Z'){
            if(i%3*i%5){
                continue;
            }
            else{
                cout<<i;
                van=1;
                break;
            }
        }
        if(a=='I'){
            if(i%3==0&&i%5){
                continue;
            }
            else{
                cout<<i;
                van=1;
                break;
            }
        }
        if(a=='A'){
            if(i%3&&i%5==0){
                continue;
            }
            else{
                cout<<i;
                van=1;
                break;
            }
        }
        if(a=='U'){
            if(i%3+i%5==0){
                continue;
            }
            else{
                cout<<i;
                van=1;
                break;
            }
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms488 KiB
2Accepted0/03ms488 KiB
3Accepted3/32ms360 KiB
4Accepted3/33ms360 KiB
5Accepted3/33ms368 KiB
6Accepted3/33ms376 KiB
7Accepted3/33ms504 KiB
8Accepted3/33ms492 KiB
9Accepted3/33ms504 KiB
10Accepted3/33ms504 KiB
11Accepted3/33ms504 KiB
12Accepted3/33ms296 KiB