結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー | chaemon |
提出日時 | 2023-12-02 15:35:01 |
言語 | Nim (2.0.2) |
結果 |
AC
|
実行時間 | 1,463 ms / 4,000 ms |
コード長 | 15,164 bytes |
コンパイル時間 | 5,125 ms |
コンパイル使用メモリ | 94,080 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 18:56:38 |
合計ジャッジ時間 | 22,767 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 3 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 24 ms
5,376 KB |
testcase_04 | AC | 1,463 ms
5,376 KB |
testcase_05 | AC | 1,457 ms
5,376 KB |
testcase_06 | AC | 1,396 ms
5,376 KB |
testcase_07 | AC | 195 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 3 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 194 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 52 ms
5,376 KB |
testcase_14 | AC | 100 ms
5,376 KB |
testcase_15 | AC | 1,459 ms
5,376 KB |
testcase_16 | AC | 194 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 3 ms
5,376 KB |
testcase_19 | AC | 741 ms
5,376 KB |
testcase_20 | AC | 14 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 2 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 2 ms
5,376 KB |
testcase_25 | AC | 2 ms
5,376 KB |
testcase_26 | AC | 378 ms
5,376 KB |
testcase_27 | AC | 1,458 ms
5,376 KB |
testcase_28 | AC | 739 ms
5,376 KB |
testcase_29 | AC | 52 ms
5,376 KB |
testcase_30 | AC | 101 ms
5,376 KB |
testcase_31 | AC | 378 ms
5,376 KB |
testcase_32 | AC | 1,456 ms
5,376 KB |
testcase_33 | AC | 51 ms
5,376 KB |
testcase_34 | AC | 1,457 ms
5,376 KB |
testcase_35 | AC | 379 ms
5,376 KB |
testcase_36 | AC | 378 ms
5,376 KB |
testcase_37 | AC | 52 ms
5,376 KB |
testcase_38 | AC | 194 ms
5,376 KB |
testcase_39 | AC | 99 ms
5,376 KB |
testcase_40 | AC | 99 ms
5,376 KB |
testcase_41 | AC | 195 ms
5,376 KB |
testcase_42 | AC | 742 ms
5,376 KB |
testcase_43 | AC | 52 ms
5,376 KB |
testcase_44 | AC | 100 ms
5,376 KB |
testcase_45 | AC | 743 ms
5,376 KB |
testcase_46 | AC | 741 ms
5,376 KB |
ソースコード
import macros macro Please(x): untyped = nnkStmtList.newTree() Please use Nim-ACL Please use Nim-ACL Please use Nim-ACL static: when not defined SecondCompile: # md5sum: 9f6f5c785cce0127ffdc80114c6378a4 atcoder.tar.xz template getFileName():string = instantiationInfo().filename let fn = getFileName() block: let (output, ex) = gorgeEx("if [ -e ./atcoder ]; then exit 1; else exit 0; fi") # doAssert ex == 0, "atcoder directory already exisits" discard staticExec("echo \"/Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4O//J3ldADCdCIqmAHyeLmzPetXzWpgQcDgKgJF+nO8CaeoEXtWYSHbA27BKPWcMDatt9oRiYKla2ZZKumzBvgJ8XgWvwb30jPACsZzUBhX/KmyAGGQcdep6Sw7RKwmcvfYLl0dcWMEP2dtZMXEw/dl1aG8SVvDPpDshijFgQ1zVTuo7cVWVjrUAU9u+FlTUWWqjF5oEib8RrQQIsJsDYoG0kgMZoxriqW+VtyFhue7rlF7T7aoSt6j/eqppv2SZHpwFw45j8xcKhGNf1RgDckQTVi4qqx7wyQG2KyIha+8wAEp3ooB6uAuGenYHAeulUIqDEwAXF6u3p6t7BaGGoggMrxzA0A/axQ2UH0mwRx832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D7tc6Qn9604IFWcRRqdY19ho5Ir1T9qhuxYKc/BAITOOTcM46WO33mQs5rULVzE/0fsMUYPz+93h3uNoTBN7nrTB3Nlf/jVoA/mQFni9AmVO+D1jaHAwBUcG9EFae6nUEuBL76fr7N+oIcsk7IaRDBH32xhRR0JjOts3qvSqTJD2eclUwm2EWRI0gnu632OnO04j6oIwAlZZgKJygAAAAAAn+oYNMhu54wAAZVPgOADAO2pyzuxxGf7AgAAAAAEWVo=\" | base64 -d > atcoder.tar.xz && tar -Jxvf atcoder.tar.xz") let (output, ex) = gorgeEx("nim cpp -d:release -d:SecondCompile -d:danger --path:./ --opt:speed --multimethods:on --warning[SmallLshouldNotBeUsed]:off --checks:off -o:a.out " & fn) discard staticExec("rm -rf ./atcoder");doAssert ex == 0, output;quit(0) when defined SecondCompile: const DO_CHECK = false;const DEBUG = false else: const DO_CHECK = true;const DEBUG = true const USE_DEFAULT_TABLE = true DO_TEST = false # see https://github.com/zer0-star/Nim-ACL/tree/master/src/atcoder/extra/header/chaemon_header.nim include atcoder/extra/header/chaemon_header proc solve() = let N, K = nextInt() let A = Seq[N: nextInt()] var S1, S2 = 0 ans = 0 proc f(L = 1, num = 0) = if num == K: if S2 <= S1: ans.inc return for x in L .. N: var S1_old = S1 S2_old = S2 S1 = (S1 + A[x - 1]) mod 998 S2 = (S2 + A[x - 1]) mod 998244353 f(x + 1, num + 1) S1 = S1_old S2 = S2_old f() echo ans mod 998 discard solve()