94232024-02-21 15:21:43Leventusz09Érdekes túra (70 pont)csharpPartially correct 60/7086ms40044 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, last = -1, l = 0, db = 0;

            for(int i=0; i<N; i++){
                if(last == M[i]){
                    if (db > o2) o2 = db;
                    if (db != 0) o1++;
                    db = 0;
                }else{
                    db++;
                    last = M[i];
                }
            }

            if (db != 0) o1++;

            Console.WriteLine("{0}\n{1}", o1, o2+1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base60/70
1Accepted0/030ms22208 KiB
2Accepted0/081ms36352 KiB
3Partially correct1/329ms22308 KiB
4Wrong answer0/329ms22688 KiB
5Partially correct2/332ms23176 KiB
6Partially correct2/330ms23720 KiB
7Accepted3/330ms23968 KiB
8Partially correct2/332ms24152 KiB
9Accepted3/335ms25056 KiB
10Accepted3/335ms25404 KiB
11Accepted3/335ms25176 KiB
12Partially correct1/337ms25280 KiB
13Accepted4/437ms25328 KiB
14Accepted4/459ms31884 KiB
15Accepted4/464ms32744 KiB
16Accepted4/468ms34612 KiB
17Accepted4/467ms33936 KiB
18Accepted4/475ms36376 KiB
19Accepted4/479ms38328 KiB
20Accepted4/486ms39068 KiB
21Accepted4/485ms40044 KiB
22Accepted4/475ms37916 KiB