37752023-03-02 21:50:39PeterBimmbamm (30)csharpWrong answer 15/3027ms22432 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(0);
            }

            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base15/30
1Accepted0/025ms19840 KiB
2Accepted0/027ms20780 KiB
3Accepted3/325ms20948 KiB
4Accepted3/325ms21120 KiB
5Accepted3/325ms21496 KiB
6Wrong answer0/325ms21428 KiB
7Accepted3/326ms21700 KiB
8Wrong answer0/326ms21976 KiB
9Wrong answer0/326ms22148 KiB
10Accepted3/326ms22036 KiB
11Wrong answer0/326ms22220 KiB
12Wrong answer0/326ms22432 KiB