78142024-01-11 11:00:45TortelliniJrBimmbamm (30)csharpAccepted 30/3028ms23760 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
base30/30
1Accepted0/027ms20340 KiB
2Accepted0/026ms20992 KiB
3Accepted3/325ms21232 KiB
4Accepted3/325ms21772 KiB
5Accepted3/325ms22020 KiB
6Accepted3/325ms21864 KiB
7Accepted3/327ms22460 KiB
8Accepted3/326ms22532 KiB
9Accepted3/326ms22964 KiB
10Accepted3/327ms23400 KiB
11Accepted3/327ms23496 KiB
12Accepted3/328ms23760 KiB