結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-21 22:38:09 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 810 bytes |
| コンパイル時間 | 3,633 ms |
| コンパイル使用メモリ | 79,060 KB |
| 実行使用メモリ | 56,320 KB |
| 最終ジャッジ日時 | 2024-09-19 20:00:04 |
| 合計ジャッジ時間 | 6,386 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 7 |
ソースコード
package shin.m;
import java.util.Scanner;
public class Kakuritsun {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("試したい最大のNを入力 : N = ");
int N = s.nextInt();
s.close();
System.out.println("n = 4から" + N + "まで");
for(int i = 4;i <= N;i++){
if(i % 2 == 1){
System.out.println("n = " + i + "で終わる確率 : 0");
}else{
int t = i / 2;
double p = ((4 * Math.sqrt(5))/(15 * 27 * Math.pow(9, t-2))) * ((2 + 2 * Math.sqrt(5)) * Math.pow((3 + Math.sqrt(5)), t-2) - (2 - 2 * Math.sqrt(5)) * Math.pow((3 - Math.sqrt(5)), t-2));
System.out.print("n = " + i + "で終わる確率 : " + p);
System.out.println(" " + Math.pow(2, i) + "/" + Math.pow(3, i) + " = " + Math.pow(2.0/3.0, i));
}
}
}
}