結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | さかぽん |
提出日時 | 2021-02-06 16:53:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 1,144 bytes |
コンパイル時間 | 4,289 ms |
コンパイル使用メモリ | 112,496 KB |
実行使用メモリ | 28,028 KB |
最終ジャッジ日時 | 2024-06-12 17:22:13 |
合計ジャッジ時間 | 8,980 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
25,396 KB |
testcase_01 | AC | 29 ms
25,408 KB |
testcase_02 | AC | 29 ms
25,332 KB |
testcase_03 | AC | 32 ms
27,484 KB |
testcase_04 | AC | 38 ms
27,756 KB |
testcase_05 | AC | 34 ms
27,764 KB |
testcase_06 | AC | 30 ms
25,072 KB |
testcase_07 | AC | 34 ms
25,840 KB |
testcase_08 | AC | 30 ms
25,328 KB |
testcase_09 | AC | 36 ms
25,584 KB |
testcase_10 | AC | 36 ms
25,456 KB |
testcase_11 | AC | 36 ms
27,772 KB |
testcase_12 | AC | 36 ms
25,860 KB |
testcase_13 | AC | 35 ms
25,968 KB |
testcase_14 | AC | 34 ms
25,840 KB |
testcase_15 | AC | 36 ms
25,868 KB |
testcase_16 | AC | 36 ms
27,884 KB |
testcase_17 | AC | 33 ms
25,536 KB |
testcase_18 | AC | 34 ms
28,028 KB |
testcase_19 | AC | 34 ms
25,712 KB |
testcase_20 | AC | 30 ms
25,268 KB |
testcase_21 | AC | 37 ms
25,460 KB |
testcase_22 | AC | 35 ms
25,712 KB |
testcase_23 | AC | 33 ms
27,748 KB |
testcase_24 | AC | 34 ms
25,712 KB |
testcase_25 | AC | 29 ms
25,576 KB |
testcase_26 | AC | 30 ms
25,180 KB |
testcase_27 | AC | 31 ms
25,308 KB |
testcase_28 | AC | 30 ms
25,460 KB |
testcase_29 | AC | 31 ms
27,352 KB |
testcase_30 | AC | 30 ms
25,440 KB |
testcase_31 | AC | 31 ms
25,448 KB |
testcase_32 | AC | 31 ms
27,344 KB |
testcase_33 | AC | 29 ms
25,376 KB |
testcase_34 | AC | 31 ms
27,216 KB |
testcase_35 | AC | 30 ms
25,064 KB |
testcase_36 | AC | 30 ms
25,388 KB |
testcase_37 | AC | 29 ms
25,380 KB |
testcase_38 | AC | 30 ms
23,340 KB |
testcase_39 | AC | 30 ms
25,320 KB |
testcase_40 | AC | 31 ms
25,452 KB |
testcase_41 | AC | 32 ms
25,448 KB |
testcase_42 | AC | 31 ms
27,616 KB |
testcase_43 | AC | 31 ms
27,400 KB |
testcase_44 | AC | 30 ms
27,312 KB |
04_evil_A_01 | RE | - |
04_evil_A_02 | RE | - |
04_evil_A_03 | RE | - |
04_evil_A_04 | RE | - |
04_evil_A_05 | RE | - |
04_evil_A_06 | RE | - |
04_evil_A_07 | RE | - |
04_evil_A_08 | RE | - |
04_evil_A_09 | RE | - |
04_evil_A_10 | RE | - |
05_evil_B_01 | RE | - |
05_evil_B_02 | RE | - |
05_evil_B_03 | RE | - |
05_evil_B_04 | RE | - |
05_evil_B_05 | RE | - |
05_evil_B_06 | RE | - |
05_evil_B_07 | RE | - |
05_evil_B_08 | RE | - |
05_evil_B_09 | RE | - |
05_evil_B_10 | RE | - |
06_evil_C_01 | RE | - |
06_evil_C_02 | RE | - |
06_evil_C_03 | RE | - |
06_evil_C_04 | RE | - |
06_evil_C_05 | RE | - |
06_evil_C_06 | RE | - |
06_evil_C_07 | RE | - |
06_evil_C_08 | RE | - |
06_evil_C_09 | RE | - |
06_evil_C_10 | AC | 31 ms
25,252 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; class A { const long M = 998244353; static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse); static (int, int, int, int) Read4() { var a = Read(); return (a[0], a[1], a[2], a[3]); } static void Main() { var (n, k, x, y) = Read4(); var a = Read(); a = a.Distinct().ToArray(); k = a.Length; var dp = NewArray2<long>(n + 1, 1 << 10); //dp[0][0] = 1; foreach (var v in a) dp[1][v] = 1; for (int i = 0; i < k; i++) { for (int j = i + 1; j < k; j++) { dp[2][a[i] ^ a[j]] += 2; } } for (int i = 2; i < n; i++) { for (int j = 0; j < 1 << 10; j++) { dp[i + 1][j] -= dp[i - 1][j] * (k - 1); dp[i + 1][j] = MInt(dp[i + 1][j]); if (dp[i][j] == 0) continue; foreach (var v in a) { var nv = j ^ v; dp[i + 1][nv] += dp[i][j] ; dp[i + 1][nv] %= M; } } } Console.WriteLine(dp[n][x..(y + 1)].Sum() % M); } static T[][] NewArray2<T>(int n1, int n2, T v = default) => Array.ConvertAll(new bool[n1], _ => Array.ConvertAll(new bool[n2], __ => v)); static long MInt(long x) => (x %= M) < 0 ? x + M : x; }