結果
| 問題 | No.1076 寿司打 |
| コンテスト | |
| ユーザー |
RISE70226821
|
| 提出日時 | 2020-08-06 17:06:47 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 452 bytes |
| 記録 | |
| コンパイル時間 | 1,595 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 42,092 KB |
| 最終ジャッジ日時 | 2026-04-09 14:13:36 |
| 合計ジャッジ時間 | 3,356 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
// 入力
Scanner sc = new Scanner(System.in);
double p = sc.nextDouble();
// 期待値算出
double exp = 0.0;
for(int x = 1; x <= 1000; x++){
exp += Math.pow(p,(double)x) * (1-p) * x;
}
// 出力
System.out.println(exp);
}
}
RISE70226821