結果

問題 No.858 わり算
ユーザー shinwisteriashinwisteria
提出日時 2019-08-30 11:25:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 3,836 ms
コンパイル使用メモリ 76,664 KB
実行使用メモリ 54,300 KB
最終ジャッジ日時 2024-04-30 21:38:33
合計ジャッジ時間 5,061 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
53,000 KB
testcase_01 AC 126 ms
53,892 KB
testcase_02 AC 125 ms
54,112 KB
testcase_03 AC 121 ms
54,028 KB
testcase_04 AC 108 ms
54,248 KB
testcase_05 AC 113 ms
53,984 KB
testcase_06 AC 112 ms
53,916 KB
testcase_07 AC 113 ms
54,300 KB
testcase_08 AC 105 ms
53,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package con_level_1half;
import java.util.Scanner;

public class Con858 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long A = s.nextLong() , B = s.nextLong();
		s.close();

		StringBuilder stb = new StringBuilder();
		stb.append(A/B);
		stb.append(".");
		long r = A%B * 10;
		for(int i = 0;i < 50;i++){
			stb.append(r/B);
			r = r%B * 10;
		}
		System.out.println(stb);
	}

}
0