15322022-11-22 12:37:27TomaSajtBimmbamm (30)cpp14Accepted 30/303ms3372 KiB
#include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;

int main() {
    speed;
    int n; cin >> n;
    for (int i = 1; i <= n; i++) {
        string s; cin >> s;
        if (i % 3 == 0 && i % 5 == 0) {
            if (s[1] != 'U') {
                cout << i;
                return 0;
            }
        }
        else if (i % 3 == 0) {
            if (s[1] != 'I') {
                cout << i;
                return 0;
            }
        }
        else if (i % 5 == 0) {
            if (s[1] != 'A') {
                cout << i;
                return 0;
            }
        }
        else {
            if (s[0] != 'S') {
                cout << i;
                return 0;
            }
        }

    }
    cout << "0";
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1828 KiB
2Accepted0/02ms2020 KiB
3Accepted3/32ms2220 KiB
4Accepted3/32ms2300 KiB
5Accepted3/32ms2304 KiB
6Accepted3/32ms2552 KiB
7Accepted3/32ms2788 KiB
8Accepted3/32ms2932 KiB
9Accepted3/32ms3100 KiB
10Accepted3/32ms3176 KiB
11Accepted3/32ms3244 KiB
12Accepted3/32ms3372 KiB