結果

問題 No.796 well known
ユーザー ikd
提出日時 2019-03-15 23:20:41
言語 Nim
(2.2.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 4,064 ms
コンパイル使用メモリ 66,176 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-07-01 21:40:02
合計ジャッジ時間 5,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 #

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