結果

問題 No.219 巨大数の概算
ユーザー spaciaspacia
提出日時 2016-06-08 14:36:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 645 ms / 1,500 ms
コード長 640 bytes
コンパイル時間 5,797 ms
コンパイル使用メモリ 75,852 KB
実行使用メモリ 63,660 KB
最終ジャッジ日時 2023-09-25 15:28:50
合計ジャッジ時間 38,438 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 605 ms
61,704 KB
testcase_01 AC 589 ms
62,168 KB
testcase_02 AC 581 ms
62,104 KB
testcase_03 AC 591 ms
61,860 KB
testcase_04 AC 563 ms
62,244 KB
testcase_05 AC 172 ms
57,044 KB
testcase_06 AC 366 ms
60,944 KB
testcase_07 AC 166 ms
56,876 KB
testcase_08 AC 366 ms
61,428 KB
testcase_09 AC 167 ms
57,404 KB
testcase_10 AC 593 ms
61,624 KB
testcase_11 AC 591 ms
61,692 KB
testcase_12 AC 598 ms
62,568 KB
testcase_13 AC 605 ms
61,888 KB
testcase_14 AC 615 ms
59,984 KB
testcase_15 AC 626 ms
62,056 KB
testcase_16 AC 595 ms
62,404 KB
testcase_17 AC 604 ms
62,132 KB
testcase_18 AC 639 ms
61,948 KB
testcase_19 AC 589 ms
61,624 KB
testcase_20 AC 567 ms
61,852 KB
testcase_21 AC 629 ms
60,100 KB
testcase_22 AC 610 ms
63,660 KB
testcase_23 AC 622 ms
62,252 KB
testcase_24 AC 627 ms
62,048 KB
testcase_25 AC 623 ms
62,328 KB
testcase_26 AC 617 ms
61,948 KB
testcase_27 AC 590 ms
62,028 KB
testcase_28 AC 608 ms
62,292 KB
testcase_29 AC 595 ms
62,380 KB
testcase_30 AC 598 ms
62,208 KB
testcase_31 AC 602 ms
62,356 KB
testcase_32 AC 618 ms
62,164 KB
testcase_33 AC 608 ms
61,956 KB
testcase_34 AC 624 ms
61,924 KB
testcase_35 AC 641 ms
62,292 KB
testcase_36 AC 608 ms
62,320 KB
testcase_37 AC 598 ms
62,308 KB
testcase_38 AC 617 ms
62,116 KB
testcase_39 AC 605 ms
62,092 KB
testcase_40 AC 617 ms
61,948 KB
testcase_41 AC 610 ms
62,572 KB
testcase_42 AC 610 ms
62,328 KB
testcase_43 AC 645 ms
63,296 KB
testcase_44 AC 632 ms
61,780 KB
testcase_45 AC 627 ms
62,196 KB
testcase_46 AC 626 ms
61,916 KB
testcase_47 AC 623 ms
62,324 KB
testcase_48 AC 618 ms
61,956 KB
testcase_49 AC 596 ms
62,188 KB
testcase_50 AC 625 ms
62,156 KB
testcase_51 AC 175 ms
57,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {

	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			solve(a, b);
		}

		sc.close();

	}

	public static void solve (int a, int b) {
		double d = Math.log10(a) * b;
		long n = (long)d;
		double m = d - n;
		BigDecimal d2 = BigDecimal.valueOf(Math.pow(10, m)).setScale(1, RoundingMode.DOWN);
		String[] out = (d2 + "").split("\\.");
		System.out.println(out[0] + " " + out[1] + " " + n);
	}

}
0