38852023-03-03 14:04:14AGergoBimmbamm (30)csharpWrong answer 3/3027ms22436 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 len = int.Parse(Console.ReadLine());

            string ans;
            string be;
            int breaks = -1;

            for (int i = 1; i < len + 1; i++)
            {

                be = Console.ReadLine();


                if (be != "BUMM" && i % 3 == 0 && i % 5 == 0)
                {
                    breaks = i;
                    break;
                }
                else if (be != "BIMM" && i % 3 == 0)
                {
                    breaks = i;
                    break;
                }
                else if (be != "BAMM" && i % 5 == 0)
                {
                    breaks = i;
                    break;
                }
                else if (be != "SZAM" && i % 5 != 0 && i % 3 != 0)
                {
                    breaks = i;
                    break;
                }
            }
            for (int i = breaks; i < len; i++)
            {
                be = Console.ReadLine();
            }

            Console.WriteLine(breaks);
            Console.ReadKey();

        }
    }
}
SubtaskSumTestVerdictTimeMemory
base3/30
1Accepted0/026ms20336 KiB
2Wrong answer0/027ms20712 KiB
3Wrong answer0/326ms20640 KiB
4Wrong answer0/325ms21068 KiB
5Accepted3/325ms21788 KiB
6Wrong answer0/326ms21984 KiB
7Wrong answer0/325ms22244 KiB
8Wrong answer0/326ms22108 KiB
9Wrong answer0/326ms21856 KiB
10Wrong answer0/326ms22084 KiB
11Wrong answer0/326ms22436 KiB
12Wrong answer0/326ms22368 KiB