Submission #1305079


Source Code Expand

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

public class Hello
{
    static long N, K;
    public static void Main()
    {
        long[] NK = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        N = NK[0];
        K = NK[1];

        Boolean[] sent = new Boolean[N];

        Console.WriteLine(DFS(0, sent, K));
    }

    public static int DFS(long current, Boolean[] sent, long remains)
    {
        if(current == N)
        {
            if (remains == 0) return 1;
            return 0;
        }

        int ret = 0;

        for(int i = 0; i < N; i++)
        {
            if (sent[i]) continue;

            sent[i] = true;
            long nextRemains = remains;
            if (i != current) nextRemains--;
            ret += DFS(current + 1, sent, nextRemains);
            sent[i] = false;
        }
        return ret % 1777777777;
    }
}

Submission Info

Submission Time
Task C - 高橋君、24歳
User TadokoroKoji
Language C# (Mono 4.6.2.0)
Score 40
Code Size 962 Byte
Status RE
Exec Time 2108 ms
Memory 12768 KB

Judge Result

Set Name small large
Score / Max Score 40 / 40 0 / 60
Status
AC × 15
AC × 15
TLE × 1
RE × 11
Set Name Test Cases
small 00_small/small_00_sample1.txt, 00_small/small_00_sample2.txt, 00_small/small_00_sample3.txt, 00_small/small_00_sample4.txt, 00_small/small_01_rand_01.txt, 00_small/small_01_rand_02.txt, 00_small/small_01_rand_03.txt, 00_small/small_01_rand_05.txt, 00_small/small_01_rand_07.txt, 00_small/small_01_rand_08.txt, 00_small/small_01_rand_09.txt, 00_small/small_01_rand_10.txt, 00_small/small_01_rand_13.txt, 00_small/small_01_rand_14.txt, 00_small/small_01_rand_18.txt
large 00_small/small_00_sample1.txt, 00_small/small_00_sample2.txt, 00_small/small_00_sample3.txt, 00_small/small_00_sample4.txt, 00_small/small_01_rand_01.txt, 00_small/small_01_rand_02.txt, 00_small/small_01_rand_03.txt, 00_small/small_01_rand_05.txt, 00_small/small_01_rand_07.txt, 00_small/small_01_rand_08.txt, 00_small/small_01_rand_09.txt, 00_small/small_01_rand_10.txt, 00_small/small_01_rand_13.txt, 00_small/small_01_rand_14.txt, 00_small/small_01_rand_18.txt, 01_large/large_00_sample5.txt, 01_large/large_01_rand_01.txt, 01_large/large_01_rand_02.txt, 01_large/large_01_rand_03.txt, 01_large/large_01_rand_05.txt, 01_large/large_01_rand_07.txt, 01_large/large_01_rand_08.txt, 01_large/large_01_rand_09.txt, 01_large/large_01_rand_10.txt, 01_large/large_01_rand_13.txt, 01_large/large_01_rand_14.txt, 01_large/large_01_rand_18.txt
Case Name Status Exec Time Memory
00_small/small_00_sample1.txt AC 22 ms 9172 KB
00_small/small_00_sample2.txt AC 23 ms 11220 KB
00_small/small_00_sample3.txt AC 23 ms 11220 KB
00_small/small_00_sample4.txt AC 24 ms 11220 KB
00_small/small_01_rand_01.txt AC 23 ms 11220 KB
00_small/small_01_rand_02.txt AC 23 ms 11220 KB
00_small/small_01_rand_03.txt AC 22 ms 9172 KB
00_small/small_01_rand_05.txt AC 23 ms 11220 KB
00_small/small_01_rand_07.txt AC 23 ms 11220 KB
00_small/small_01_rand_08.txt AC 23 ms 11220 KB
00_small/small_01_rand_09.txt AC 24 ms 11220 KB
00_small/small_01_rand_10.txt AC 23 ms 11348 KB
00_small/small_01_rand_13.txt AC 23 ms 11220 KB
00_small/small_01_rand_14.txt AC 23 ms 11220 KB
00_small/small_01_rand_18.txt AC 23 ms 11348 KB
01_large/large_00_sample5.txt TLE 2108 ms 10592 KB
01_large/large_01_rand_01.txt RE 21 ms 10720 KB
01_large/large_01_rand_02.txt RE 21 ms 8672 KB
01_large/large_01_rand_03.txt RE 21 ms 10720 KB
01_large/large_01_rand_05.txt RE 21 ms 10720 KB
01_large/large_01_rand_07.txt RE 21 ms 10720 KB
01_large/large_01_rand_08.txt RE 21 ms 8672 KB
01_large/large_01_rand_09.txt RE 22 ms 12768 KB
01_large/large_01_rand_10.txt RE 21 ms 10720 KB
01_large/large_01_rand_13.txt RE 21 ms 10720 KB
01_large/large_01_rand_14.txt RE 21 ms 10720 KB
01_large/large_01_rand_18.txt RE 22 ms 12768 KB