結果
問題 | No.51 やる気の問題 |
ユーザー |
![]() |
提出日時 | 2015-12-07 17:09:02 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 60 ms / 5,000 ms |
コード長 | 512 bytes |
コンパイル時間 | 2,252 ms |
コンパイル使用メモリ | 75,020 KB |
実行使用メモリ | 50,528 KB |
最終ジャッジ日時 | 2024-09-14 18:26:57 |
合計ジャッジ時間 | 4,483 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { int W = Integer.parseInt(buff.readLine()); double D = Double.parseDouble(buff.readLine()); while(D > 1){ W -= (int)(W / Math.pow(D, 2)); D--; } System.out.println(W); } catch (NumberFormatException e) { } catch (IOException e) { } } }