45712023-03-30 08:53:40Leventusz19Kert (75 pont)csharpTime limit exceeded 26/75574ms34444 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));
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base26/75
1Accepted0/030ms21804 KiB
2Time limit exceeded0/0556ms7952 KiB
3Partially correct2/429ms22908 KiB
4Accepted4/432ms23160 KiB
5Partially correct2/439ms31460 KiB
6Accepted4/437ms31496 KiB
7Partially correct2/437ms31364 KiB
8Partially correct2/437ms31812 KiB
9Partially correct2/439ms32100 KiB
10Partially correct2/446ms34444 KiB
11Partially correct3/641ms33264 KiB
12Partially correct3/6142ms27724 KiB
13Time limit exceeded0/6573ms8808 KiB
14Time limit exceeded0/6574ms10032 KiB
15Time limit exceeded0/6572ms23332 KiB
16Time limit exceeded0/6558ms10332 KiB
17Time limit exceeded0/7558ms9316 KiB