37722023-03-02 21:46:09PeterBimmbamm (30)csharpWrong answer 15/3027ms23148 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bimm__bamm__bumm
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string currentszam;

            //Be kell olvasni először mindenképpen egy tömbbe, mivel egyébként azonnal bezárná magát a program
            string[] X = new string[N];

            int i = 0;
            for (i = 0; i < N; i++)
            {
                X[i] = Console.ReadLine();
            }

            for (i = 1; i <= N; i++)
            {
                if (X[i-1] =="BUMM" && (i%3!=0) && (i%5!=0)) //Osztható 3-al és 5-el
                {
                    Console.WriteLine(i);
                    break;
                }
                else if (X[i-1] =="BIMM"&&i%3!=0)
                {
                    Console.WriteLine(i);
                    break;
                }
                else if (X[i-1] == "BAMM"&&i%5!=0)
                {
                    Console.WriteLine(i);
                    break;
                }
            }
            if (i>N)
            {
                Console.WriteLine(-1);
            }

            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base15/30
1Accepted0/025ms20172 KiB
2Accepted0/027ms20776 KiB
3Accepted3/326ms20724 KiB
4Accepted3/326ms20960 KiB
5Accepted3/327ms21612 KiB
6Wrong answer0/326ms21824 KiB
7Accepted3/326ms22172 KiB
8Wrong answer0/326ms22156 KiB
9Wrong answer0/325ms22592 KiB
10Accepted3/327ms23148 KiB
11Wrong answer0/326ms22952 KiB
12Wrong answer0/326ms22940 KiB