結果

問題 No.796 well known
ユーザー ikdikd
提出日時 2019-03-15 23:20:41
言語 Nim
(2.0.2)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 3,772 ms
コンパイル使用メモリ 68,084 KB
実行使用メモリ 9,912 KB
最終ジャッジ日時 2023-09-14 14:18:11
合計ジャッジ時間 5,322 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 11 ms
8,940 KB
testcase_05 AC 11 ms
8,972 KB
testcase_06 AC 13 ms
9,912 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 12 ms
9,020 KB
testcase_09 AC 6 ms
6,412 KB
testcase_10 AC 13 ms
9,868 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 6 ms
5,804 KB
testcase_13 AC 11 ms
8,872 KB
testcase_14 AC 5 ms
5,048 KB
testcase_15 AC 6 ms
6,020 KB
testcase_16 AC 13 ms
9,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 34) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]

ソースコード

diff #

import strutils, sequtils, math, future

proc main() =
  let n = stdin.readLine.strip.parseInt
  var ans = newSeq[int](n)
  ans[0] = 3
  for i in 1..<n:
    ans[i] = 1
  if ans.sum mod 3 == 0:
    ans[n - 1] += 1
  elif ans.sum mod 3 == 2:
    ans[n - 1] += 2
  echo ans.map(it => $it).join(" ")
main()
0