結果

問題 No.713 素数の和
コンテスト
ユーザー toshiro_yanagi
提出日時 2018-07-23 13:05:04
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 236 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,434 ms
コンパイル使用メモリ 67,292 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-21 20:22:34
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import strutils, math

proc judge(n: int): int =
  var i = 2
  while i ^ 2 <= n:
    if n mod i == 0:
      return
    i += 1
  return n

let
  N = parseInt readLine stdin
var
  cnt = 0


for i in 2 .. N:
  cnt += i.judge

echo cnt
    
0