結果

問題 No.796 well known
コンテスト
ユーザー ikd
提出日時 2019-03-15 23:20:41
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 303 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,517 ms
コンパイル使用メモリ 68,620 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2026-03-23 00:39:08
合計ジャッジ時間 3,671 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 34) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]

ソースコード

diff #
raw source code

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