結果
| 問題 | 
                            No.1076 寿司打
                             | 
                    
| コンテスト | |
| ユーザー | 
                             RISE70226821
                         | 
                    
| 提出日時 | 2020-08-06 17:06:47 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 139 ms / 2,000 ms | 
| コード長 | 452 bytes | 
| コンパイル時間 | 2,129 ms | 
| コンパイル使用メモリ | 74,092 KB | 
| 実行使用メモリ | 41,892 KB | 
| 最終ジャッジ日時 | 2024-09-21 07:18:49 | 
| 合計ジャッジ時間 | 4,738 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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