139652025-01-09 13:00:29BalintbuziBimmbamm (30)csharpRuntime error 0/3014ms3116 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bimmbamm
{
    internal class Program
    {
        static void Main(string[] args)
        {
            
            int a = int.Parse(Console.ReadLine());
            string[]b =new string[a];
            int hiba = 0;
            for (int i = 0; i < a; i++)
            {
                
                b[i] = Console.ReadLine();
                if ((i + 1) % 3 == 0 && (b[i] == "SZAM" || b[i]=="BAMM"))
                {
                    hiba = (i + 1);
                }
                if ((i + 1) % 5 == 0 && (b[i] == "SZAM" || b[i] == "BIMM"))
                {
                    hiba = (i + 1);
                }
                if ((i + 1) % 5 == 0 && (i+1)%3==0 && (b[i] == "SZAM" || b[i] == "BIMM" || b[i]=="BAMM"))
                {
                    hiba = (i + 1);
                }
                if ((i+1)%5!=0&& (i + 1) % 3 != 0 && b[i]!="SZAM")
                {
                    hiba = (i + 1);
                }
            }
            Console.WriteLine(hiba);








            
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Runtime error0/014ms2816 KiB
2Runtime error0/014ms2960 KiB
3Runtime error0/314ms2752 KiB
4Runtime error0/314ms2688 KiB
5Runtime error0/314ms2724 KiB
6Runtime error0/314ms2752 KiB
7Runtime error0/314ms2612 KiB
8Runtime error0/314ms2844 KiB
9Runtime error0/314ms2872 KiB
10Runtime error0/314ms2768 KiB
11Runtime error0/314ms3116 KiB
12Runtime error0/314ms2836 KiB