63282023-11-20 08:04:36CsongiBimmbamm (30)csharpAccepted 30/3028ms22172 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bimmbamm
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] tomb = new string[n+1];
            bool[] ter = new bool[tomb.Length];
            for (int i = 1; i <= n; i++)
            {
                tomb[i] = Console.ReadLine();
                if (tomb[i] == "SZAM" && i % 3 != 0 && i % 5 != 0)
                    ter[i] = true;
                else if (tomb[i] == "BIMM" && i % 3 == 0 && i % 5 != 0)
                    ter[i] = true;
                else if (tomb[i] == "BAMM" && i % 3 != 0 && i % 5 == 0)
                    ter[i] = true;
                else if (tomb[i] == "BUMM" && i % 3 == 0 && i % 5 == 0)
                    ter[i] = true;
                else
                    ter[i] = false;
            }
            for (int i = 1; i <= ter.Length; i++)
            {
                if (ter[i] == false)
                {
                    Console.WriteLine(i);
                    break;
                }               
            }
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/027ms20172 KiB
2Accepted0/026ms20424 KiB
3Accepted3/326ms21068 KiB
4Accepted3/328ms21368 KiB
5Accepted3/327ms21712 KiB
6Accepted3/326ms21932 KiB
7Accepted3/326ms21900 KiB
8Accepted3/326ms21948 KiB
9Accepted3/326ms21992 KiB
10Accepted3/326ms22124 KiB
11Accepted3/326ms21880 KiB
12Accepted3/326ms22172 KiB