結果

問題 No.285 消費税2
ユーザー TatsuDXTatsuDX
提出日時 2016-10-16 22:20:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 3,975 ms
コンパイル使用メモリ 77,964 KB
実行使用メモリ 41,776 KB
最終ジャッジ日時 2024-05-02 02:43:38
合計ジャッジ時間 9,120 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
41,104 KB
testcase_01 AC 139 ms
41,356 KB
testcase_02 AC 153 ms
41,776 KB
testcase_03 AC 147 ms
41,392 KB
testcase_04 AC 133 ms
41,316 KB
testcase_05 AC 154 ms
41,756 KB
testcase_06 AC 150 ms
41,456 KB
testcase_07 AC 147 ms
41,380 KB
testcase_08 AC 148 ms
41,436 KB
testcase_09 AC 145 ms
41,548 KB
testcase_10 AC 148 ms
41,684 KB
testcase_11 AC 151 ms
41,732 KB
testcase_12 AC 147 ms
41,368 KB
testcase_13 AC 149 ms
41,580 KB
testcase_14 AC 147 ms
41,592 KB
testcase_15 AC 145 ms
41,644 KB
testcase_16 AC 147 ms
41,696 KB
testcase_17 AC 151 ms
41,484 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 150 ms
41,712 KB
testcase_21 AC 151 ms
41,392 KB
testcase_22 AC 138 ms
40,276 KB
testcase_23 AC 148 ms
41,664 KB
testcase_24 WA -
testcase_25 AC 132 ms
41,412 KB
testcase_26 AC 149 ms
41,560 KB
testcase_27 AC 147 ms
41,420 KB
testcase_28 WA -
testcase_29 AC 149 ms
41,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long[] m = new long[10];
		long n = sc.nextLong();
		for(int i = 1; i < 10; i++){
			m[i] = n % 100;
			n /= 100;
		}
		for(int i = 1; i < 10; i++){
			m[i-1] += m[i]*8;
			m[i] += m[i-1]/100;
			m[i-1] %= 100;
		}
		long a = 0;
		for(int i = 9; i > 0; i--){
			a *= 100;
			a += m[i];
		}
		System.out.print(a);
		if(m[0] > 0){
			System.out.println("." + m[0]);
		} else {
			System.out.println();
		}
	}
}
0