143092025-01-10 13:24:31MagyarKendeSZLGBimmbamm (30)csharpRuntime error 0/3014ms2888 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n; i++)
            {
                string szo = Console.ReadLine();
                string helyes = "";
                if (i % 3 != 0 && i % 5 != 0)
                {
                    helyes = "SZAM";
                }
                else if (i % 3 == 0 && i % 5 == 0)
                {
                    helyes = "BUMM";
                }
                else if (i % 3 == 0)
                {
                    helyes = "BIMM";
                }
                else
                {
                    helyes = "BAMM";
                }
                if (szo != helyes)
                {
                    Console.WriteLine(i);
                    return;
                }
            }
            Console.WriteLine(0);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Runtime error0/014ms2768 KiB
2Runtime error0/014ms2888 KiB
3Runtime error0/314ms2784 KiB
4Runtime error0/314ms2800 KiB
5Runtime error0/314ms2764 KiB
6Runtime error0/314ms2748 KiB
7Runtime error0/314ms2776 KiB
8Runtime error0/314ms2868 KiB
9Runtime error0/314ms2772 KiB
10Runtime error0/314ms2748 KiB
11Runtime error0/314ms2720 KiB
12Runtime error0/314ms2840 KiB