Submission #6369831


Source Code Expand

using System;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;


static class P
{
    static void Main()
    {
        var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var a = Enumerable.Repeat(0, nm[0]).Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();
        var possible = nm[0];
        var impossible = 0;
        while (possible - impossible > 1)
        {
            var mid = (possible + impossible) / 2;
            if (Judge(a, mid)) possible = mid;
            else impossible = mid;
        }
        Console.WriteLine(possible);
    }

    static bool Judge(int[][] a, int target)
    {
        while (a[0].Length > 0)
        {
            var invalidList = a.Select(x => x[0]).GroupBy(x => x).Where(x => target < x.Count()).Select(x => x.Key).ToArray();
            if (invalidList.Length == 0) return true;
            a = a.Select(x => x.Except(invalidList).ToArray()).ToArray();
        }
        return false;
    }
}

Submission Info

Submission Time
Task B - Sports Festival
User keymoon
Language C# (Mono 4.6.2.0)
Score 0
Code Size 1383 Byte
Status TLE
Exec Time 2109 ms
Memory 37204 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
AC × 3
AC × 22
TLE × 2
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt
Case Name Status Exec Time Memory
sample_01.txt AC 40 ms 11732 KB
sample_02.txt AC 36 ms 11732 KB
sample_03.txt AC 36 ms 11732 KB
subtask_1_01.txt AC 27 ms 11476 KB
subtask_1_02.txt AC 37 ms 9684 KB
subtask_1_03.txt AC 60 ms 15940 KB
subtask_1_04.txt AC 46 ms 15824 KB
subtask_1_05.txt AC 36 ms 9684 KB
subtask_1_06.txt AC 66 ms 16452 KB
subtask_1_07.txt AC 776 ms 34036 KB
subtask_1_08.txt AC 74 ms 16184 KB
subtask_1_09.txt AC 37 ms 11732 KB
subtask_1_10.txt AC 39 ms 11732 KB
subtask_1_11.txt AC 678 ms 30540 KB
subtask_1_12.txt AC 38 ms 11732 KB
subtask_1_13.txt AC 195 ms 21584 KB
subtask_1_14.txt AC 131 ms 18972 KB
subtask_1_15.txt TLE 2109 ms 33696 KB
subtask_1_16.txt AC 152 ms 24452 KB
subtask_1_17.txt AC 966 ms 37204 KB
subtask_1_18.txt TLE 2109 ms 36068 KB