結果
問題 | No.462 6日知らずのコンピュータ |
ユーザー | AreTrash |
提出日時 | 2016-12-13 06:12:22 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 2,827 bytes |
コンパイル時間 | 868 ms |
コンパイル使用メモリ | 112,576 KB |
実行使用メモリ | 19,584 KB |
最終ジャッジ日時 | 2024-11-30 00:37:51 |
合計ジャッジ時間 | 5,225 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
19,200 KB |
testcase_01 | AC | 32 ms
19,328 KB |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | AC | 31 ms
19,200 KB |
testcase_07 | RE | - |
testcase_08 | WA | - |
testcase_09 | AC | 31 ms
19,200 KB |
testcase_10 | AC | 32 ms
19,328 KB |
testcase_11 | AC | 32 ms
19,456 KB |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | WA | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | AC | 31 ms
19,328 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | AC | 31 ms
19,200 KB |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | WA | - |
testcase_28 | AC | 32 ms
19,456 KB |
testcase_29 | RE | - |
testcase_30 | WA | - |
testcase_31 | RE | - |
testcase_32 | WA | - |
testcase_33 | AC | 33 ms
19,584 KB |
testcase_34 | RE | - |
testcase_35 | AC | 32 ms
19,200 KB |
testcase_36 | RE | - |
testcase_37 | WA | - |
testcase_38 | AC | 33 ms
19,456 KB |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | AC | 32 ms
19,584 KB |
testcase_45 | AC | 33 ms
19,328 KB |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | AC | 33 ms
19,200 KB |
testcase_50 | RE | - |
testcase_51 | AC | 31 ms
19,200 KB |
testcase_52 | RE | - |
testcase_53 | AC | 32 ms
19,584 KB |
testcase_54 | AC | 30 ms
19,328 KB |
testcase_55 | AC | 31 ms
19,200 KB |
testcase_56 | RE | - |
testcase_57 | RE | - |
testcase_58 | AC | 32 ms
19,328 KB |
testcase_59 | RE | - |
testcase_60 | RE | - |
testcase_61 | AC | 34 ms
19,328 KB |
testcase_62 | AC | 32 ms
19,456 KB |
testcase_63 | AC | 33 ms
19,200 KB |
testcase_64 | AC | 32 ms
19,072 KB |
testcase_65 | AC | 33 ms
19,584 KB |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | AC | 33 ms
19,456 KB |
testcase_71 | RE | - |
testcase_72 | AC | 31 ms
19,328 KB |
testcase_73 | AC | 33 ms
19,200 KB |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | RE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | AC | 32 ms
19,328 KB |
testcase_80 | WA | - |
testcase_81 | AC | 32 ms
19,456 KB |
testcase_82 | WA | - |
testcase_83 | WA | - |
testcase_84 | AC | 31 ms
19,456 KB |
testcase_85 | AC | 31 ms
19,072 KB |
testcase_86 | AC | 31 ms
19,328 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; namespace No462{ public class Program{ public static void Main(string[] args){ var sr = new StreamReader(); //--------------------------------- var N = sr.Next<int>(); var K = sr.Next<int>(); var A = sr.Next<int>(K); const int mod = 1000000009; var mf = Ex.ModFac(100, mod); var a = A .Concat(new[]{0, (int)Ex.ModPow(2, N, mod) - 1}) .Select(x => Convert.ToString(x, 2).PadLeft(N, '0')) .OrderBy(x => x.Count(c => c == '1')).ToArray(); var res = 1L; for(var i = 1; i < K + 2; i++){ for(var j = 0; j < N; j++) if(a[i - 1][j] == '1' && a[i][j] == '0') res = 0L; res *= mf[a[i].Count(c => c == '1') - a[i - 1].Count(c => c == '1')]; res %= mod; } Console.WriteLine(res); //--------------------------------- } } public class Ex{ public static long[] ModFac(int n, int mod){ var ret = new long[n]; ret[0] = 1; for(var i = 1; i < n; i++) ret[i] = ret[i - 1] * i % mod; return ret; } public static long ModPow(int x, int pow, int mod){ var ret = 1L; for(var i = 0; i < pow; i++){ ret *= x; ret %= mod; } return ret; } } public class StreamReader{ private readonly char[] _c = {' '}; private int _index = -1; private string[] _input = new string[0]; private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput()); public T Next<T>(){ if(_index == _input.Length - 1){ _index = -1; while(true){ string rl = _sr.ReadLine(); if(rl == null){ if(typeof(T).IsClass) return default(T); return (T)typeof(T).GetField("MinValue").GetValue(null); } if(rl != ""){ _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries); break; } } } return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture); } public T[] Next<T>(int x){ var ret = new T[x]; for(var i = 0; i < x; ++i) ret[i] = Next<T>(); return ret; } public T[][] Next<T>(int y, int x){ var ret = new T[y][]; for(var i = 0; i < y; ++i) ret[i] = Next<T>(x); return ret; } } }