結果
問題 | No.462 6日知らずのコンピュータ |
ユーザー | 14番 |
提出日時 | 2016-12-14 21:06:11 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 3,180 bytes |
コンパイル時間 | 1,003 ms |
コンパイル使用メモリ | 113,872 KB |
実行使用メモリ | 19,712 KB |
最終ジャッジ日時 | 2024-11-30 07:37:37 |
合計ジャッジ時間 | 6,351 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
19,456 KB |
testcase_01 | AC | 39 ms
19,456 KB |
testcase_02 | AC | 39 ms
19,456 KB |
testcase_03 | AC | 40 ms
19,456 KB |
testcase_04 | AC | 38 ms
19,200 KB |
testcase_05 | AC | 39 ms
19,456 KB |
testcase_06 | AC | 37 ms
19,456 KB |
testcase_07 | AC | 39 ms
19,200 KB |
testcase_08 | AC | 32 ms
19,072 KB |
testcase_09 | AC | 38 ms
19,328 KB |
testcase_10 | AC | 39 ms
19,328 KB |
testcase_11 | AC | 38 ms
19,456 KB |
testcase_12 | AC | 39 ms
19,584 KB |
testcase_13 | AC | 40 ms
19,456 KB |
testcase_14 | AC | 41 ms
19,456 KB |
testcase_15 | AC | 40 ms
19,456 KB |
testcase_16 | AC | 40 ms
19,200 KB |
testcase_17 | AC | 40 ms
19,200 KB |
testcase_18 | AC | 41 ms
19,328 KB |
testcase_19 | AC | 40 ms
19,328 KB |
testcase_20 | AC | 40 ms
19,328 KB |
testcase_21 | AC | 40 ms
19,456 KB |
testcase_22 | AC | 41 ms
19,200 KB |
testcase_23 | AC | 41 ms
19,456 KB |
testcase_24 | AC | 41 ms
19,456 KB |
testcase_25 | AC | 42 ms
19,328 KB |
testcase_26 | AC | 40 ms
19,200 KB |
testcase_27 | AC | 40 ms
19,456 KB |
testcase_28 | AC | 38 ms
19,456 KB |
testcase_29 | AC | 40 ms
19,328 KB |
testcase_30 | AC | 38 ms
19,200 KB |
testcase_31 | AC | 39 ms
19,456 KB |
testcase_32 | AC | 39 ms
19,328 KB |
testcase_33 | AC | 39 ms
19,584 KB |
testcase_34 | AC | 39 ms
19,200 KB |
testcase_35 | AC | 41 ms
19,328 KB |
testcase_36 | AC | 39 ms
19,456 KB |
testcase_37 | AC | 40 ms
19,200 KB |
testcase_38 | AC | 39 ms
19,456 KB |
testcase_39 | AC | 39 ms
19,328 KB |
testcase_40 | AC | 38 ms
19,328 KB |
testcase_41 | AC | 40 ms
19,584 KB |
testcase_42 | AC | 39 ms
19,200 KB |
testcase_43 | AC | 40 ms
19,456 KB |
testcase_44 | AC | 39 ms
19,584 KB |
testcase_45 | AC | 37 ms
19,328 KB |
testcase_46 | AC | 39 ms
19,712 KB |
testcase_47 | AC | 39 ms
19,456 KB |
testcase_48 | AC | 39 ms
19,456 KB |
testcase_49 | AC | 39 ms
19,456 KB |
testcase_50 | AC | 39 ms
19,328 KB |
testcase_51 | AC | 39 ms
19,456 KB |
testcase_52 | AC | 39 ms
19,456 KB |
testcase_53 | AC | 38 ms
19,328 KB |
testcase_54 | AC | 39 ms
19,328 KB |
testcase_55 | AC | 39 ms
19,328 KB |
testcase_56 | AC | 38 ms
19,456 KB |
testcase_57 | AC | 39 ms
19,328 KB |
testcase_58 | AC | 38 ms
19,456 KB |
testcase_59 | AC | 39 ms
19,456 KB |
testcase_60 | AC | 38 ms
19,328 KB |
testcase_61 | AC | 38 ms
19,200 KB |
testcase_62 | AC | 38 ms
19,328 KB |
testcase_63 | AC | 39 ms
19,200 KB |
testcase_64 | AC | 39 ms
19,328 KB |
testcase_65 | AC | 38 ms
19,328 KB |
testcase_66 | AC | 39 ms
19,328 KB |
testcase_67 | AC | 38 ms
19,584 KB |
testcase_68 | AC | 39 ms
19,456 KB |
testcase_69 | AC | 39 ms
19,328 KB |
testcase_70 | AC | 38 ms
19,328 KB |
testcase_71 | AC | 39 ms
19,584 KB |
testcase_72 | AC | 39 ms
19,328 KB |
testcase_73 | AC | 40 ms
19,328 KB |
testcase_74 | AC | 39 ms
19,200 KB |
testcase_75 | AC | 39 ms
19,456 KB |
testcase_76 | AC | 38 ms
19,328 KB |
testcase_77 | AC | 38 ms
19,584 KB |
testcase_78 | AC | 41 ms
19,328 KB |
testcase_79 | AC | 32 ms
19,072 KB |
testcase_80 | AC | 31 ms
19,072 KB |
testcase_81 | AC | 31 ms
19,200 KB |
testcase_82 | AC | 31 ms
19,072 KB |
testcase_83 | AC | 31 ms
19,328 KB |
testcase_84 | AC | 39 ms
19,200 KB |
testcase_85 | AC | 37 ms
19,328 KB |
testcase_86 | AC | 30 ms
19,072 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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(); } }