45932023-03-30 10:37:26Leventusz19Kert (75 pont)csharpTime limit exceeded 26/75573ms34360 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, j, last; i<in1[0]; i++){
                S = Console.ReadLine().Split().Select(int.Parse).ToArray();
                last = 0;
                o2 = 0;
                p = new int[in1[2]];
                for(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];
                }
                //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/032ms21804 KiB
2Time limit exceeded0/0560ms6064 KiB
3Partially correct2/432ms22308 KiB
4Accepted4/432ms23084 KiB
5Partially correct2/452ms31424 KiB
6Accepted4/452ms31360 KiB
7Partially correct2/452ms31880 KiB
8Partially correct2/454ms31996 KiB
9Partially correct2/454ms32492 KiB
10Partially correct2/461ms34360 KiB
11Partially correct3/659ms33252 KiB
12Partially correct3/6425ms27376 KiB
13Time limit exceeded0/6555ms8320 KiB
14Time limit exceeded0/6573ms9204 KiB
15Time limit exceeded0/6550ms16588 KiB
16Time limit exceeded0/6568ms9140 KiB
17Time limit exceeded0/7563ms8732 KiB