14872022-11-18 17:06:051478Bimmbamm (30)cpp11Elfogadva 30/303ms3404 KiB
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

int main()
{
    //ifstream cin("be.txt");
    int n;
    cin >> n;
    int i;
    for (i = 1; i <= n; i++)
    {
        string s;
        cin >> s;
        if (i % 3 == 0 && i % 5 == 0)
        {
            if (s != "BUMM")
                break;
        }
        else if (i % 3 == 0)
        {
            if (s != "BIMM")
                break;
        }
        else if (i % 5 == 0)
        {
            if (s != "BAMM")
                break;
        }
        else if (s != "SZAM")
            break;
    }
    cout << i;

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base30/30
1Elfogadva0/03ms1808 KiB
2Elfogadva0/02ms1904 KiB
3Elfogadva3/32ms2124 KiB
4Elfogadva3/32ms2320 KiB
5Elfogadva3/32ms2512 KiB
6Elfogadva3/32ms2592 KiB
7Elfogadva3/32ms2716 KiB
8Elfogadva3/32ms2916 KiB
9Elfogadva3/32ms3124 KiB
10Elfogadva3/32ms3328 KiB
11Elfogadva3/32ms3404 KiB
12Elfogadva3/32ms3404 KiB