結果
| 問題 |
No.144 エラトステネスのざる
|
| コンテスト | |
| ユーザー |
6soukiti29
|
| 提出日時 | 2017-09-14 21:33:50 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| コード長 | 305 bytes |
| コンパイル時間 | 3,127 ms |
| コンパイル使用メモリ | 67,004 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-06-30 03:11:14 |
| 合計ジャッジ時間 | 4,320 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport] /home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'strutils' [UnusedImport]
ソースコード
import sequtils,strutils,strscans
var
N : int
p : float
s = stdin.readline
A : array[1000002, float]
ans : float
discard scanf(s,"$i $f", N, p)
for i in 2..N:
A[i] = 1
for i in 2..N:
ans += A[i]
var j = i * 2
while j <= N:
A[j] *= 1 - p
j += i
echo ans
6soukiti29