結果

問題 No.462 6日知らずのコンピュータ
ユーザー 14番14番
提出日時 2016-12-14 21:06:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 3,180 bytes
コンパイル時間 2,539 ms
コンパイル使用メモリ 106,904 KB
実行使用メモリ 26,220 KB
最終ジャッジ日時 2023-08-20 06:54:44
合計ジャッジ時間 11,202 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
21,960 KB
testcase_01 AC 71 ms
22,080 KB
testcase_02 AC 74 ms
24,240 KB
testcase_03 AC 73 ms
21,940 KB
testcase_04 AC 71 ms
21,980 KB
testcase_05 AC 70 ms
22,076 KB
testcase_06 AC 69 ms
21,980 KB
testcase_07 AC 71 ms
22,020 KB
testcase_08 AC 62 ms
23,884 KB
testcase_09 AC 70 ms
22,172 KB
testcase_10 AC 71 ms
23,988 KB
testcase_11 AC 72 ms
22,008 KB
testcase_12 AC 71 ms
21,984 KB
testcase_13 AC 72 ms
22,020 KB
testcase_14 AC 72 ms
22,116 KB
testcase_15 AC 72 ms
22,020 KB
testcase_16 AC 71 ms
22,088 KB
testcase_17 AC 72 ms
21,992 KB
testcase_18 AC 71 ms
19,952 KB
testcase_19 AC 70 ms
22,056 KB
testcase_20 AC 73 ms
21,968 KB
testcase_21 AC 72 ms
24,104 KB
testcase_22 AC 71 ms
22,004 KB
testcase_23 AC 72 ms
21,904 KB
testcase_24 AC 71 ms
24,164 KB
testcase_25 AC 72 ms
21,988 KB
testcase_26 AC 72 ms
23,972 KB
testcase_27 AC 72 ms
24,180 KB
testcase_28 AC 72 ms
24,080 KB
testcase_29 AC 72 ms
22,064 KB
testcase_30 AC 70 ms
22,184 KB
testcase_31 AC 71 ms
22,124 KB
testcase_32 AC 72 ms
22,012 KB
testcase_33 AC 73 ms
22,044 KB
testcase_34 AC 72 ms
21,932 KB
testcase_35 AC 71 ms
24,020 KB
testcase_36 AC 72 ms
22,044 KB
testcase_37 AC 70 ms
22,096 KB
testcase_38 AC 71 ms
22,064 KB
testcase_39 AC 71 ms
22,016 KB
testcase_40 AC 70 ms
19,948 KB
testcase_41 AC 71 ms
24,112 KB
testcase_42 AC 71 ms
20,076 KB
testcase_43 AC 71 ms
24,028 KB
testcase_44 AC 72 ms
22,204 KB
testcase_45 AC 71 ms
24,076 KB
testcase_46 AC 72 ms
21,992 KB
testcase_47 AC 72 ms
21,984 KB
testcase_48 AC 72 ms
22,120 KB
testcase_49 AC 71 ms
22,056 KB
testcase_50 AC 71 ms
22,072 KB
testcase_51 AC 71 ms
20,020 KB
testcase_52 AC 72 ms
22,000 KB
testcase_53 AC 72 ms
22,064 KB
testcase_54 AC 72 ms
20,048 KB
testcase_55 AC 71 ms
20,020 KB
testcase_56 AC 71 ms
22,000 KB
testcase_57 AC 72 ms
24,024 KB
testcase_58 AC 73 ms
23,976 KB
testcase_59 AC 72 ms
22,056 KB
testcase_60 AC 73 ms
24,232 KB
testcase_61 AC 72 ms
21,984 KB
testcase_62 AC 70 ms
22,016 KB
testcase_63 AC 72 ms
22,072 KB
testcase_64 AC 72 ms
22,168 KB
testcase_65 AC 71 ms
21,992 KB
testcase_66 AC 72 ms
22,068 KB
testcase_67 AC 72 ms
24,048 KB
testcase_68 AC 72 ms
24,084 KB
testcase_69 AC 71 ms
23,960 KB
testcase_70 AC 71 ms
22,136 KB
testcase_71 AC 72 ms
19,952 KB
testcase_72 AC 72 ms
22,092 KB
testcase_73 AC 72 ms
22,056 KB
testcase_74 AC 71 ms
24,052 KB
testcase_75 AC 73 ms
24,236 KB
testcase_76 AC 72 ms
22,004 KB
testcase_77 AC 73 ms
24,064 KB
testcase_78 AC 72 ms
26,220 KB
testcase_79 AC 62 ms
20,004 KB
testcase_80 AC 62 ms
23,952 KB
testcase_81 AC 62 ms
22,012 KB
testcase_82 AC 62 ms
23,944 KB
testcase_83 AC 64 ms
25,816 KB
testcase_84 AC 71 ms
23,972 KB
testcase_85 AC 72 ms
21,912 KB
testcase_86 AC 62 ms
21,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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

public class Program
{
    public void Proc() {
        Reader.IsDebug = false;
        int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray();

        this.Length = inpt[0];

        if(inpt[1] == 0) {
            this.NumList = new long[] {0, ((long)1<<this.Length)-1};
        } else {
            this.NumList = new long[] {0, ((long)1<<this.Length)-1}.Union(Reader.ReadLine().Split(' ').Select(a=>long.Parse(a))).OrderBy(a=>a).ToArray();
        }

        long ans = 1;

        for(int i=1; i<NumList.Length; i++) {
            string prev = Convert.ToString(NumList[i-1], 2);
            string current = Convert.ToString(NumList[i], 2);
            prev = prev.PadLeft(current.Length);
            for(int j=0; j<current.Length; j++) {
                if(current[j] == '0' && prev[j] == '1') {
                    Console.WriteLine(0);
                    return;
                }
            }
            int cnt = current.Count(a=>a=='1')-prev.Count(a=>a=='1');
            for(int j=1; j<=cnt; j++) {
                ans *= j;
                ans = ans % MOD;
            }
        }
        Console.WriteLine(ans);

    }

    private const long MOD = 1000000000 + 7;

    private int Length = 0;

    private long[] NumList;
    public class Reader {
        public static bool IsDebug = true;
        private static System.IO.StringReader SReader;
        private static string InitText = @"

60 61
0 576460752303423488 864691128455135232 1008806316530991104 1080863910568919040 1116892707587883008 1134907106097364992 1143914305352105984 1148417904979476480 1150669704793161728 1151795604700004352 1152358554653425664 1152640029630136320 1152780767118491648 1152851135862669312 1152886320234758144 1152903912420802560 1152912708513824768 1152917106560335872 1152919305583591424 1152920405095219200 1152920954851033088 1152921229728940032 1152921367167893504 1152921435887370240 1152921470247108608 1152921487426977792 1152921496016912384 1152921500311879680 1152921502459363328 1152921503533105152 1152921504069976064 1152921504338411520 1152921504472629248 1152921504539738112 1152921504573292544 1152921504590069760 1152921504598458368 1152921504602652672 1152921504604749824 1152921504605798400 1152921504606322688 1152921504606584832 1152921504606715904 1152921504606781440 1152921504606814208 1152921504606830592 1152921504606838784 1152921504606842880 1152921504606844928 1152921504606845952 1152921504606846464 1152921504606846720 1152921504606846848 1152921504606846912 1152921504606846944 1152921504606846960 1152921504606846968 1152921504606846972 1152921504606846974 1152921504606846975


";
        public static string ReadLine() {
            if(IsDebug) {
                if(SReader == null) {
                    SReader = new System.IO.StringReader(InitText.Trim());
                }
                return SReader.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }
    }
    public static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0