結果

問題 No.2889 Rusk
ユーザー kemunikukemuniku
提出日時 2024-09-13 02:27:58
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 3,733 bytes
コンパイル時間 3,373 ms
コンパイル使用メモリ 75,920 KB
実行使用メモリ 16,556 KB
最終ジャッジ日時 2024-09-13 02:28:07
合計ジャッジ時間 8,684 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,944 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 6 ms
6,944 KB
testcase_15 AC 20 ms
6,940 KB
testcase_16 WA -
testcase_17 AC 15 ms
6,940 KB
testcase_18 WA -
testcase_19 AC 79 ms
11,392 KB
testcase_20 AC 97 ms
13,440 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 69 ms
8,576 KB
testcase_24 AC 98 ms
13,312 KB
testcase_25 WA -
testcase_26 AC 78 ms
11,136 KB
testcase_27 AC 101 ms
13,696 KB
testcase_28 AC 61 ms
9,600 KB
testcase_29 AC 62 ms
9,472 KB
testcase_30 WA -
testcase_31 AC 102 ms
13,696 KB
testcase_32 AC 44 ms
7,424 KB
testcase_33 AC 13 ms
6,944 KB
testcase_34 AC 118 ms
15,744 KB
testcase_35 WA -
testcase_36 AC 120 ms
15,360 KB
testcase_37 AC 115 ms
15,360 KB
testcase_38 WA -
testcase_39 AC 81 ms
14,592 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 58 ms
11,008 KB
testcase_46 AC 17 ms
6,944 KB
testcase_47 AC 30 ms
7,040 KB
testcase_48 AC 69 ms
12,416 KB
testcase_49 AC 2 ms
6,940 KB
testcase_50 AC 2 ms
6,944 KB
testcase_51 AC 1 ms
6,940 KB
testcase_52 AC 2 ms
6,940 KB
testcase_53 AC 2 ms
6,940 KB
testcase_54 AC 121 ms
15,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#WA想定提出です。
#サンプル落ちるけど...
import macros;macro ImportExpand(s:untyped):untyped = parseStmt($s[2])



ImportExpand "cplib/tmpl/sheep.nim" <=== "when not declared CPLIB_TMPL_SHEEP:\n    const CPLIB_TMPL_SHEEP* = 1\n    {.warning[UnusedImport]: off.}\n    {.hint[XDeclaredButNotUsed]: off.}\n    import algorithm\n    import sequtils\n    import tables\n    import macros\n    import math\n    import sets\n    import strutils\n    import strformat\n    import sugar\n    import heapqueue\n    import streams\n    import deques\n    import bitops\n    import std/lenientops\n    import options\n    #入力系\n    proc scanf(formatstr: cstring){.header: \"<stdio.h>\", varargs.}\n    proc getchar(): char {.importc: \"getchar_unlocked\", header: \"<stdio.h>\", discardable.}\n    proc ii(): int {.inline.} = scanf(\"%lld\\n\", addr result)\n    proc lii(N: int): seq[int] {.inline.} = newSeqWith(N, ii())\n    proc si(): string {.inline.} =\n        result = \"\"\n        var c: char\n        while true:\n            c = getchar()\n            if c == ' ' or c == '\\n':\n                break\n            result &= c\n    #chmin,chmax\n    template `max=`(x, y) = x = max(x, y)\n    template `min=`(x, y) = x = min(x, y)\n    #bit演算\n    proc `%`*(x: int, y: int): int =\n        result = x mod y\n        if y > 0 and result < 0: result += y\n        if y < 0 and result > 0: result += y\n    proc `//`*(x: int, y: int): int{.inline.} =\n        result = x div y\n        if y > 0 and result * y > x: result -= 1\n        if y < 0 and result * y < x: result -= 1\n    proc `%=`(x: var int, y: int): void = x = x%y\n    proc `//=`(x: var int, y: int): void = x = x//y\n    proc `**`(x: int, y: int): int = x^y\n    proc `**=`(x: var int, y: int): void = x = x^y\n    proc `^`(x: int, y: int): int = x xor y\n    proc `|`(x: int, y: int): int = x or y\n    proc `&`(x: int, y: int): int = x and y\n    proc `>>`(x: int, y: int): int = x shr y\n    proc `<<`(x: int, y: int): int = x shl y\n    proc `~`(x: int): int = not x\n    proc `^=`(x: var int, y: int): void = x = x ^ y\n    proc `&=`(x: var int, y: int): void = x = x & y\n    proc `|=`(x: var int, y: int): void = x = x | y\n    proc `>>=`(x: var int, y: int): void = x = x >> y\n    proc `<<=`(x: var int, y: int): void = x = x << y\n    proc `[]`(x: int, n: int): bool = (x and (1 shl n)) != 0\n    #便利な変換\n    proc `!`(x: char, a = '0'): int = int(x)-int(a)\n    #定数\n    #[ include cplib/utils/constants ]#\n    when not declared CPLIB_UTILS_CONSTANTS:\n        const CPLIB_UTILS_CONSTANTS* = 1\n        const INF32*: int32 = 100100111.int32\n        const INF64*: int = int(3300300300300300491)\n    const INF = INF64\n    #converter\n\n    #range\n    iterator range(start: int, ends: int, step: int): int =\n        var i = start\n        if step < 0:\n            while i > ends:\n                yield i\n                i += step\n        elif step > 0:\n            while i < ends:\n                yield i\n                i += step\n    iterator range(ends: int): int = (for i in 0..<ends: yield i)\n    iterator range(start: int, ends: int): int = (for i in\n            start..<ends: yield i)\n\n    #joinが非stringでめちゃくちゃ遅いやつのパッチ\n    proc join*[T: not string](a: openArray[T], sep: string = \"\"): string = a.mapit($it).join(sep)\n"

var N = ii()
var A = lii(N)
var B = lii(N)
var C = lii(N)

var DP = newseqwith(5,newseqwith(N+1,-INF))
DP[0][0] = 0

for i in range(N):
    var tmp = [A[i],B[i],C[i],B[i],A[i]]
    for j in range(5):
        for k in range(j,5):
            DP[k][i+1].max = DP[j][i] + tmp[k]
var ans = -INF
for i in range(5):
    ans.max = DP[i][^1]
echo ans
0