結果

問題 No.462 6日知らずのコンピュータ
ユーザー htensaihtensai
提出日時 2019-12-12 20:12:24
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 808 bytes
コンパイル時間 4,182 ms
コンパイル使用メモリ 71,892 KB
実行使用メモリ 58,012 KB
最終ジャッジ日時 2023-09-07 20:34:19
合計ジャッジ時間 18,377 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,380 KB
testcase_01 AC 123 ms
55,644 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 127 ms
56,208 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 WA -
testcase_28 WA -
testcase_29 RE -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
testcase_33 AC 128 ms
55,880 KB
testcase_34 RE -
testcase_35 WA -
testcase_36 RE -
testcase_37 WA -
testcase_38 WA -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 WA -
testcase_45 WA -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 AC 122 ms
55,912 KB
testcase_50 RE -
testcase_51 AC 124 ms
55,784 KB
testcase_52 RE -
testcase_53 AC 125 ms
55,600 KB
testcase_54 AC 123 ms
56,296 KB
testcase_55 AC 126 ms
55,700 KB
testcase_56 RE -
testcase_57 RE -
testcase_58 AC 129 ms
55,632 KB
testcase_59 RE -
testcase_60 RE -
testcase_61 AC 127 ms
55,636 KB
testcase_62 WA -
testcase_63 AC 131 ms
55,884 KB
testcase_64 AC 126 ms
55,480 KB
testcase_65 AC 125 ms
56,188 KB
testcase_66 RE -
testcase_67 RE -
testcase_68 RE -
testcase_69 RE -
testcase_70 AC 126 ms
56,096 KB
testcase_71 RE -
testcase_72 AC 125 ms
56,452 KB
testcase_73 AC 127 ms
55,936 KB
testcase_74 RE -
testcase_75 RE -
testcase_76 RE -
testcase_77 RE -
testcase_78 RE -
testcase_79 AC 124 ms
56,044 KB
testcase_80 AC 123 ms
55,576 KB
testcase_81 AC 124 ms
55,640 KB
testcase_82 AC 125 ms
55,600 KB
testcase_83 AC 124 ms
55,788 KB
testcase_84 AC 125 ms
55,932 KB
testcase_85 AC 125 ms
57,996 KB
testcase_86 AC 124 ms
56,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] arr = new int[k];
        for (int i = 0; i < k; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        for (int i = 0; i < k - 1; i++) {
            if ((arr[i] & arr[i + 1]) != arr[i]) {
                System.out.println(0);
                return;
            }
        }
        System.out.println(kaijo(n - k));
    }
    
    static long kaijo(long x) {
        long ret = 1;
        int mod = 1000000007;
        for (long i = 1; i <= x; i++) {
            ret *= i;
            ret %= mod;
        }
        return ret;
    }
}
0