結果

問題 No.192 合成数
ユーザー mkanenobu
提出日時 2018-04-04 22:10:56
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 2,490 ms
コンパイル使用メモリ 65,212 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 05:44:37
合計ジャッジ時間 3,586 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(8, 5) Warning: Using an unnamed break in a block is deprecated; Use a named block with a named break instead [UnnamedBreak]
/home/judge/data/code/Main.nim(1, 39) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 28) Warning: imported and not used: 'algorithm' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, algorithm, math

var n = readLine(stdin).parseInt

block:
  if n mod 2 == 0:
    echo n
    break
  else:
    for i in (n - 100) .. (n + 100):
      if (i > 0 and i mod 2 == 0) and not (i == 2):
        echo i
        break
0