結果

問題 No.379 五円硬貨
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 14:38:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 452 bytes
コンパイル時間 2,898 ms
コンパイル使用メモリ 74,268 KB
実行使用メモリ 54,312 KB
最終ジャッジ日時 2024-04-27 15:20:04
合計ジャッジ時間 5,776 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
53,784 KB
testcase_01 AC 114 ms
53,848 KB
testcase_02 AC 98 ms
52,208 KB
testcase_03 AC 99 ms
52,832 KB
testcase_04 AC 116 ms
54,292 KB
testcase_05 AC 112 ms
54,104 KB
testcase_06 AC 115 ms
54,088 KB
testcase_07 AC 113 ms
54,208 KB
testcase_08 AC 115 ms
54,060 KB
testcase_09 AC 120 ms
53,892 KB
testcase_10 AC 114 ms
54,164 KB
testcase_11 AC 112 ms
53,800 KB
testcase_12 AC 102 ms
52,820 KB
testcase_13 AC 115 ms
54,068 KB
testcase_14 AC 114 ms
54,028 KB
testcase_15 AC 105 ms
52,976 KB
testcase_16 AC 115 ms
53,844 KB
testcase_17 AC 120 ms
54,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), g = sc.nextLong(), v = sc.nextLong();
		long m = n / 5, a = m * g / v, b = (m * g) % v;
		System.out.print(a);
		if (b == 0) {
			return;
		}
		System.out.print(".");
		for (int i = 0; b > 0 && i < 12; i++) {
			System.out.print((b * 10) / v);
			b = (b * 10) % v;
		}
		System.out.println();
	}
}
0