結果
問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
ユーザー |
![]() |
提出日時 | 2015-08-14 15:21:17 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 527 bytes |
コンパイル時間 | 1,887 ms |
コンパイル使用メモリ | 74,924 KB |
実行使用メモリ | 41,868 KB |
最終ジャッジ日時 | 2024-07-18 09:23:43 |
合計ジャッジ時間 | 6,161 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 2 RE * 28 |
ソースコード
import java.io.*; import java.math.*; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; BigDecimal x=new BigDecimal("0.0"); while((line=br.readLine())!=null&&!line.isEmpty()){ int n=Integer.parseInt(line); for(int i=0;i<n;i++){ BigDecimal y=new BigDecimal(line); x=x.add(y); } x=x.setScale(10,RoundingMode.HALF_UP); out.printf("%.10f",x); out.flush(); } } }