結果

問題 No.379 五円硬貨
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 14:38:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 452 bytes
コンパイル時間 3,374 ms
コンパイル使用メモリ 71,156 KB
実行使用メモリ 56,452 KB
最終ジャッジ日時 2023-08-09 20:49:55
合計ジャッジ時間 6,983 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,124 KB
testcase_01 AC 125 ms
55,952 KB
testcase_02 AC 126 ms
55,972 KB
testcase_03 AC 123 ms
55,992 KB
testcase_04 AC 126 ms
56,032 KB
testcase_05 AC 123 ms
55,940 KB
testcase_06 AC 125 ms
55,864 KB
testcase_07 AC 125 ms
55,784 KB
testcase_08 AC 124 ms
55,820 KB
testcase_09 AC 124 ms
55,416 KB
testcase_10 AC 125 ms
55,864 KB
testcase_11 AC 126 ms
55,832 KB
testcase_12 AC 123 ms
55,864 KB
testcase_13 AC 121 ms
55,804 KB
testcase_14 AC 121 ms
55,884 KB
testcase_15 AC 127 ms
56,452 KB
testcase_16 AC 120 ms
55,872 KB
testcase_17 AC 122 ms
55,812 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