Submission #53893552


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


    internal class Program
    {
        public static void Main(string[] args)
        {
            // 結果
            int ans = -1;

            // 入力・宣言
            var nt = Console.ReadLine().Split();
            int n = Convert.ToInt32(nt[0]);
            int t = Convert.ToInt32(nt[1]);
            var lintT = Console.ReadLine().Split();
            int[] a = new int[t];
            for (int i = 0; i < t; i++)
            {
                a[i] = Convert.ToInt32(lintT[i]) - 1;
            }
            bool[,] bingo = new bool[n, n];

            // 処理
            for (int i = 0; i < t; ++i)
            {
                bingo[a[i] / n, a[i] % n] = true;

                for (int j = 0; j < n; ++j)
                {
                    for (int k = 0; k < n; ++k)
                    {
                        if (!bingo[j, k])
                        {
                            break;
                        }
                        else if (k == n - 1)
                        {
                            ans = i + 1;
                            Console.WriteLine(ans);
                            return;
                        }
                    }
                    for (int k = 0; k < n; ++k)
                    {
                        if (!bingo[k, j])
                        {
                            break;
                        }
                        else if (k == n - 1)
                        {
                            ans = i + 1;
                            Console.WriteLine(ans);
                            return;
                        }
                    }
                    for (int k = 0; k < n; ++k)
                    {
                        if (!bingo[k, n - k - 1])
                        {
                            break;
                        }
                        else if (k == n - 1)
                        {
                            ans = i + 1;
                            Console.WriteLine(ans);
                            return;
                        }
                    }
                    for (int k = 0; k < n; ++k)
                    {
                        if (!bingo[k, k])
                        {
                            break;
                        }
                        else if (k == n - 1)
                        {
                            ans = i + 1;
                            Console.WriteLine(ans);
                            return;
                        }
                    }
                }
            }
            Console.WriteLine(ans + 1);
        }
    
    
        
}

Submission Info

Submission Time
Task C - Bingo 2
User beef
Language C# 11.0 (.NET 7.0.7)
Score 0
Code Size 2861 Byte
Status WA
Exec Time 2212 ms
Memory 44584 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
WA × 1
AC × 18
WA × 9
TLE × 12
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt, 01_random_34.txt, 01_random_35.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 40 ms 24628 KiB
00_sample_01.txt WA 38 ms 24448 KiB
00_sample_02.txt AC 38 ms 24632 KiB
01_random_00.txt AC 44 ms 24620 KiB
01_random_01.txt AC 34 ms 24684 KiB
01_random_02.txt AC 32 ms 24640 KiB
01_random_03.txt AC 37 ms 24456 KiB
01_random_04.txt AC 41 ms 25076 KiB
01_random_05.txt WA 39 ms 24692 KiB
01_random_06.txt AC 49 ms 24820 KiB
01_random_07.txt WA 43 ms 24476 KiB
01_random_08.txt WA 1060 ms 42100 KiB
01_random_09.txt WA 1492 ms 44032 KiB
01_random_10.txt WA 1116 ms 42288 KiB
01_random_11.txt WA 1273 ms 42960 KiB
01_random_12.txt WA 1508 ms 43900 KiB
01_random_13.txt WA 1931 ms 44156 KiB
01_random_14.txt AC 1839 ms 39464 KiB
01_random_15.txt AC 1997 ms 39224 KiB
01_random_16.txt AC 1236 ms 39432 KiB
01_random_17.txt AC 1652 ms 39328 KiB
01_random_18.txt AC 1248 ms 39228 KiB
01_random_19.txt TLE 2004 ms 39240 KiB
01_random_20.txt AC 1247 ms 42684 KiB
01_random_21.txt AC 1333 ms 43216 KiB
01_random_22.txt AC 1304 ms 43040 KiB
01_random_23.txt AC 1225 ms 42544 KiB
01_random_24.txt AC 1837 ms 42384 KiB
01_random_25.txt TLE 2210 ms 43200 KiB
01_random_26.txt TLE 2209 ms 43412 KiB
01_random_27.txt TLE 2210 ms 44108 KiB
01_random_28.txt TLE 2209 ms 39316 KiB
01_random_29.txt TLE 2209 ms 39452 KiB
01_random_30.txt TLE 2210 ms 44584 KiB
01_random_31.txt TLE 2210 ms 44464 KiB
01_random_32.txt TLE 2212 ms 39236 KiB
01_random_33.txt TLE 2210 ms 39476 KiB
01_random_34.txt TLE 2210 ms 44560 KiB
01_random_35.txt TLE 2210 ms 44364 KiB