94132024-02-21 14:07:13Leventusz09Érdekes túra (70 pont)csharpWrong answer 35/7085ms43880 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Érdekes_túra{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            int[] M = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int o1 = 0, o2 = 0;

            for(int i=0, l=-1, ldb = 0; i<N; i++){
                if(M[i] != l){
                    ldb++;
                    l = M[i];
                }else{
                    if (ldb > o2) o2 = ldb;
                    if (ldb != 0) o1++;
                    ldb = 0;
                }
            }

            Console.WriteLine("{0}\n{1}", o1, o2+1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base35/70
1Accepted0/032ms22192 KiB
2Wrong answer0/085ms36792 KiB
3Wrong answer0/332ms23020 KiB
4Wrong answer0/332ms23664 KiB
5Partially correct2/332ms23472 KiB
6Partially correct2/330ms23836 KiB
7Accepted3/332ms23972 KiB
8Partially correct2/332ms24352 KiB
9Partially correct2/335ms25320 KiB
10Partially correct2/339ms25464 KiB
11Partially correct2/337ms25528 KiB
12Wrong answer0/337ms26052 KiB
13Partially correct2/437ms26364 KiB
14Partially correct2/461ms33456 KiB
15Partially correct2/464ms34560 KiB
16Partially correct2/468ms37060 KiB
17Partially correct2/467ms36716 KiB
18Partially correct2/471ms39096 KiB
19Partially correct2/482ms41564 KiB
20Partially correct2/482ms42408 KiB
21Partially correct2/483ms43880 KiB
22Partially correct2/476ms42072 KiB