45972023-03-30 10:42:41Leventusz19Kert (75 pont)csharpTime limit exceeded 26/75582ms34796 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();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base26/75
1Accepted0/032ms22320 KiB
2Time limit exceeded0/0560ms6668 KiB
3Partially correct2/432ms22936 KiB
4Accepted4/432ms23164 KiB
5Partially correct2/452ms31296 KiB
6Accepted4/454ms31656 KiB
7Partially correct2/454ms31616 KiB
8Partially correct2/454ms31592 KiB
9Partially correct2/454ms32364 KiB
10Partially correct2/461ms34796 KiB
11Partially correct3/659ms33332 KiB
12Partially correct3/6414ms27328 KiB
13Time limit exceeded0/6575ms8772 KiB
14Time limit exceeded0/6564ms9220 KiB
15Time limit exceeded0/6535ms16784 KiB
16Time limit exceeded0/6582ms9192 KiB
17Time limit exceeded0/7566ms9052 KiB