4571 2023. 03. 30 08:53:40 Leventusz19 Kert (75 pont) csharp Időlimit túllépés 26/75 574ms 34444 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kert{
    class Program{
        static void Main(string[] args){
            int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] S;
            int[] p = new int[in1[2]];
            int o1 = 0, o2 = 0, o2t=0, o2m=0;
            for(int i=0, last; i<in1[0]; i++){
                S = Console.ReadLine().Split().Select(int.Parse).ToArray();
                last = 0;
                o2 = 0;
                p = new int[in1[2]];
                for(int j=0; j<in1[1]; j++){
                    p[S[j]-1]++;
                    if (S[j] == last){
                        o2++;
                        if (o2 > o2m){
                            o2t = i;
                            o2m = o2;
                        }
                    }
                    last = S[j];
                }
                foreach(int j in p) if (j > in1[1] / 2) o1++;
            }
            Console.WriteLine(o1 + "\n" + (o2t+1));
        }
    }
}
Részfeladat Összpont Teszt Verdikt Idő Memória
base 26/75
1 Elfogadva 0/0 30ms 21804 KiB
2 Időlimit túllépés 0/0 556ms 7952 KiB
3 Részben helyes 2/4 29ms 22908 KiB
4 Elfogadva 4/4 32ms 23160 KiB
5 Részben helyes 2/4 39ms 31460 KiB
6 Elfogadva 4/4 37ms 31496 KiB
7 Részben helyes 2/4 37ms 31364 KiB
8 Részben helyes 2/4 37ms 31812 KiB
9 Részben helyes 2/4 39ms 32100 KiB
10 Részben helyes 2/4 46ms 34444 KiB
11 Részben helyes 3/6 41ms 33264 KiB
12 Részben helyes 3/6 142ms 27724 KiB
13 Időlimit túllépés 0/6 573ms 8808 KiB
14 Időlimit túllépés 0/6 574ms 10032 KiB
15 Időlimit túllépés 0/6 572ms 23332 KiB
16 Időlimit túllépés 0/6 558ms 10332 KiB
17 Időlimit túllépés 0/7 558ms 9316 KiB