結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | さかぽん |
提出日時 | 2021-02-06 17:07:37 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 1,100 bytes |
コンパイル時間 | 5,145 ms |
コンパイル使用メモリ | 115,264 KB |
実行使用メモリ | 27,880 KB |
最終ジャッジ日時 | 2024-06-12 17:23:15 |
合計ジャッジ時間 | 7,538 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 33 ms
27,240 KB |
testcase_01 | AC | 34 ms
25,200 KB |
testcase_02 | AC | 33 ms
25,068 KB |
testcase_03 | AC | 34 ms
25,320 KB |
testcase_04 | AC | 39 ms
27,600 KB |
testcase_05 | AC | 37 ms
25,708 KB |
testcase_06 | AC | 32 ms
25,460 KB |
testcase_07 | AC | 40 ms
27,620 KB |
testcase_08 | AC | 35 ms
25,176 KB |
testcase_09 | AC | 39 ms
25,452 KB |
testcase_10 | AC | 37 ms
25,608 KB |
testcase_11 | AC | 37 ms
25,840 KB |
testcase_12 | AC | 38 ms
25,584 KB |
testcase_13 | AC | 37 ms
25,588 KB |
testcase_14 | AC | 37 ms
25,840 KB |
testcase_15 | AC | 37 ms
27,592 KB |
testcase_16 | AC | 37 ms
25,716 KB |
testcase_17 | AC | 34 ms
25,328 KB |
testcase_18 | AC | 37 ms
25,844 KB |
testcase_19 | AC | 37 ms
25,584 KB |
testcase_20 | AC | 33 ms
27,168 KB |
testcase_21 | AC | 42 ms
27,756 KB |
testcase_22 | AC | 37 ms
25,328 KB |
testcase_23 | AC | 39 ms
27,880 KB |
testcase_24 | AC | 39 ms
25,868 KB |
testcase_25 | AC | 33 ms
25,380 KB |
testcase_26 | AC | 34 ms
25,436 KB |
testcase_27 | AC | 35 ms
25,176 KB |
testcase_28 | AC | 33 ms
27,240 KB |
testcase_29 | AC | 34 ms
25,648 KB |
testcase_30 | AC | 32 ms
25,252 KB |
testcase_31 | AC | 32 ms
25,256 KB |
testcase_32 | AC | 35 ms
27,236 KB |
testcase_33 | AC | 34 ms
27,228 KB |
testcase_34 | AC | 36 ms
27,228 KB |
testcase_35 | AC | 32 ms
23,344 KB |
testcase_36 | AC | 33 ms
25,132 KB |
testcase_37 | AC | 33 ms
25,316 KB |
testcase_38 | AC | 32 ms
23,216 KB |
testcase_39 | AC | 33 ms
25,448 KB |
testcase_40 | AC | 33 ms
25,328 KB |
testcase_41 | AC | 34 ms
27,236 KB |
testcase_42 | AC | 34 ms
27,360 KB |
testcase_43 | AC | 32 ms
25,484 KB |
testcase_44 | AC | 33 ms
25,448 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 | 32 ms
25,456 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); 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; }