115402024-10-22 15:21:07SzmolikGusztavBimmbamm (30)csharpRuntime error 0/3014ms2996 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bimmbammbumm
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string f;
            int h = -1;
            for (int i = 1; i <= n; i++)
            {
                f = Console.ReadLine();
                if (((i % 3 != 0 && i % 5 != 0 && f != "SZAM") || (i % 3 == 0 && i % 5 != 0 && f != "BIMM") || (i % 3 != 0 && i % 5 == 0 && f != "BAMM") || (i % 3 == 0 && i % 5 == 0 && f != "BUMM")) && h == -1)
                {
                    h = i;
                }
            }
            Console.WriteLine(h);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Runtime error0/014ms2836 KiB
2Runtime error0/014ms2776 KiB
3Runtime error0/314ms2608 KiB
4Runtime error0/314ms2528 KiB
5Runtime error0/314ms2624 KiB
6Runtime error0/314ms2728 KiB
7Runtime error0/314ms2708 KiB
8Runtime error0/314ms2996 KiB
9Runtime error0/314ms2532 KiB
10Runtime error0/314ms2544 KiB
11Runtime error0/314ms2752 KiB
12Runtime error0/314ms2852 KiB