139672025-01-09 13:02:50Hanxlz729Bimmbamm (30)csharpRuntime error 0/3014ms2968 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {            
            int n = Convert.ToInt32(Console.ReadLine());
            string input = "";
            int hiba = 0;

            for (int i = 1; i < n+1; i++)
            {
                input = Console.ReadLine();
                if ((input == "SZAM" || input == "BIMM" || input == "BAMM" || input == "BUMM"))
                {
                    if (!((double)i % 3 != 0 && input == "SZAM" && (double)i % 5 != 0))
                    {
                        if (!((double)i % 3 == 0 && input == "BIMM" && (double)i % 5 != 0))
                        {
                            if (!((double)i % 3 != 0 && input == "BAMM" && (double)i % 5 == 0))
                            {
                                if (!((double)i % 3 == 0 && input == "BUMM" && (double)i % 5 == 0) && hiba == 0)
                                {
                                    hiba = i;
                                }
                            }
                        }
                    }                   
                }
            }
            Console.WriteLine(hiba);           
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Runtime error0/014ms2764 KiB
2Runtime error0/014ms2548 KiB
3Runtime error0/314ms2868 KiB
4Runtime error0/314ms2768 KiB
5Runtime error0/314ms2412 KiB
6Runtime error0/314ms2736 KiB
7Runtime error0/314ms2764 KiB
8Runtime error0/314ms2572 KiB
9Runtime error0/314ms2968 KiB
10Runtime error0/314ms2804 KiB
11Runtime error0/314ms2736 KiB
12Runtime error0/314ms2768 KiB