4597 2023. 03. 30 10:42:41 Leventusz19 Kert (75 pont) csharp Időlimit túllépés 26/75 582ms 34796 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]];
                foreach(int j in S){
                    p[j-1]++;
                    if (j == last){
                        o2++;
                        if (o2 > o2m){
                            o2t = i;
                            o2m = o2;
                        }
                    }
                    last = j;
                }
                //p.Select(x);
                if (p.Max() > in1[1] / 2) o1++;
                //foreach (int k in p) if (k > in1[1] / 2) o1++;
            }
            Console.WriteLine(o1 + "\n" + (o2t+1));
            Console.ReadKey();
        }
    }
}
Részfeladat Összpont Teszt Verdikt Idő Memória
base 26/75
1 Elfogadva 0/0 32ms 22320 KiB
2 Időlimit túllépés 0/0 560ms 6668 KiB
3 Részben helyes 2/4 32ms 22936 KiB
4 Elfogadva 4/4 32ms 23164 KiB
5 Részben helyes 2/4 52ms 31296 KiB
6 Elfogadva 4/4 54ms 31656 KiB
7 Részben helyes 2/4 54ms 31616 KiB
8 Részben helyes 2/4 54ms 31592 KiB
9 Részben helyes 2/4 54ms 32364 KiB
10 Részben helyes 2/4 61ms 34796 KiB
11 Részben helyes 3/6 59ms 33332 KiB
12 Részben helyes 3/6 414ms 27328 KiB
13 Időlimit túllépés 0/6 575ms 8772 KiB
14 Időlimit túllépés 0/6 564ms 9220 KiB
15 Időlimit túllépés 0/6 535ms 16784 KiB
16 Időlimit túllépés 0/6 582ms 9192 KiB
17 Időlimit túllépés 0/7 566ms 9052 KiB