結果

問題 No.285 消費税2
ユーザー TatsuDXTatsuDX
提出日時 2016-10-16 22:21:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 3,267 ms
コンパイル使用メモリ 73,328 KB
実行使用メモリ 56,324 KB
最終ジャッジ日時 2023-08-14 14:41:11
合計ジャッジ時間 8,384 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,156 KB
testcase_01 AC 122 ms
56,056 KB
testcase_02 AC 123 ms
56,324 KB
testcase_03 AC 123 ms
55,784 KB
testcase_04 AC 121 ms
56,028 KB
testcase_05 AC 123 ms
56,148 KB
testcase_06 AC 122 ms
56,008 KB
testcase_07 AC 125 ms
55,832 KB
testcase_08 AC 122 ms
55,804 KB
testcase_09 AC 126 ms
55,996 KB
testcase_10 AC 121 ms
55,800 KB
testcase_11 AC 122 ms
55,868 KB
testcase_12 AC 121 ms
55,780 KB
testcase_13 AC 121 ms
55,552 KB
testcase_14 AC 123 ms
55,888 KB
testcase_15 AC 122 ms
56,272 KB
testcase_16 AC 122 ms
56,076 KB
testcase_17 AC 122 ms
55,684 KB
testcase_18 AC 123 ms
56,096 KB
testcase_19 AC 121 ms
56,304 KB
testcase_20 AC 122 ms
56,136 KB
testcase_21 AC 122 ms
56,160 KB
testcase_22 AC 123 ms
55,696 KB
testcase_23 AC 123 ms
56,076 KB
testcase_24 AC 122 ms
55,772 KB
testcase_25 AC 120 ms
56,136 KB
testcase_26 AC 122 ms
53,728 KB
testcase_27 AC 122 ms
55,736 KB
testcase_28 AC 122 ms
55,768 KB
testcase_29 AC 123 ms
56,116 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.printf(".%02d",m[0]);
		}
		System.out.println();
	}
}
0