78162024-01-11 11:17:08NotYouBimmbamm (30)csharpAccepted 30/3028ms22964 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bimm_bamm_bumm
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string f;
            int ind = -1;
            for (int i = 1; i < n+1; 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")) && ind == -1)
                {
                    ind = i;
                }
            }
            Console.WriteLine(ind);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/027ms20456 KiB
2Accepted0/026ms20972 KiB
3Accepted3/326ms20804 KiB
4Accepted3/325ms21180 KiB
5Accepted3/325ms21496 KiB
6Accepted3/326ms21956 KiB
7Accepted3/326ms22264 KiB
8Accepted3/326ms22528 KiB
9Accepted3/326ms22964 KiB
10Accepted3/328ms22872 KiB
11Accepted3/327ms22832 KiB
12Accepted3/327ms22752 KiB