結果

問題 No.219 巨大数の概算
ユーザー takeya_okinotakeya_okino
提出日時 2019-09-24 22:25:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,338 ms / 1,500 ms
コード長 771 bytes
コンパイル時間 2,306 ms
コンパイル使用メモリ 77,640 KB
実行使用メモリ 67,952 KB
最終ジャッジ日時 2023-10-19 16:26:25
合計ジャッジ時間 66,885 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,255 ms
67,644 KB
testcase_01 AC 1,276 ms
67,264 KB
testcase_02 AC 1,292 ms
67,212 KB
testcase_03 AC 1,237 ms
67,440 KB
testcase_04 AC 1,059 ms
67,084 KB
testcase_05 AC 203 ms
59,052 KB
testcase_06 AC 600 ms
66,576 KB
testcase_07 AC 202 ms
59,056 KB
testcase_08 AC 575 ms
65,612 KB
testcase_09 AC 196 ms
58,976 KB
testcase_10 AC 1,222 ms
67,112 KB
testcase_11 AC 1,266 ms
67,440 KB
testcase_12 AC 1,307 ms
67,184 KB
testcase_13 AC 1,260 ms
67,268 KB
testcase_14 AC 1,132 ms
66,864 KB
testcase_15 AC 1,278 ms
67,108 KB
testcase_16 AC 1,276 ms
65,528 KB
testcase_17 AC 1,312 ms
67,128 KB
testcase_18 AC 1,211 ms
67,660 KB
testcase_19 AC 1,295 ms
67,796 KB
testcase_20 AC 1,323 ms
67,256 KB
testcase_21 AC 1,324 ms
67,824 KB
testcase_22 AC 1,230 ms
67,540 KB
testcase_23 AC 1,269 ms
67,588 KB
testcase_24 AC 1,241 ms
67,216 KB
testcase_25 AC 1,299 ms
67,560 KB
testcase_26 AC 1,276 ms
67,744 KB
testcase_27 AC 1,283 ms
67,228 KB
testcase_28 AC 1,270 ms
67,288 KB
testcase_29 AC 1,298 ms
67,436 KB
testcase_30 AC 1,214 ms
65,356 KB
testcase_31 AC 1,241 ms
65,756 KB
testcase_32 AC 1,335 ms
67,932 KB
testcase_33 AC 1,288 ms
67,172 KB
testcase_34 AC 1,302 ms
67,504 KB
testcase_35 AC 1,221 ms
67,296 KB
testcase_36 AC 1,286 ms
65,372 KB
testcase_37 AC 1,276 ms
67,368 KB
testcase_38 AC 1,284 ms
67,216 KB
testcase_39 AC 1,240 ms
67,140 KB
testcase_40 AC 1,230 ms
67,764 KB
testcase_41 AC 1,224 ms
67,180 KB
testcase_42 AC 1,258 ms
67,324 KB
testcase_43 AC 1,243 ms
67,800 KB
testcase_44 AC 1,122 ms
67,464 KB
testcase_45 AC 1,322 ms
67,952 KB
testcase_46 AC 1,338 ms
66,892 KB
testcase_47 AC 1,270 ms
67,188 KB
testcase_48 AC 1,248 ms
67,108 KB
testcase_49 AC 1,263 ms
67,216 KB
testcase_50 AC 1,181 ms
67,508 KB
testcase_51 AC 195 ms
58,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.BigDecimal;

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++) {
      double a = sc.nextDouble();
      double b = sc.nextDouble();
      BigDecimal A = new BigDecimal((double)Math.log10(a));
      BigDecimal B = new BigDecimal(b);
      BigDecimal t = B.multiply(A);
      long z = t.longValue();
      BigDecimal Z = new BigDecimal(z);
      BigDecimal t1 = t.subtract(Z);
      double t2 = (double)Math.pow(10, t1.doubleValue());
      String s = String.valueOf(t2);
      String x = String.valueOf(s.charAt(0));
      String y = String.valueOf(s.charAt(2));
      System.out.println(x + " " + y + " " + z);
    }
  }
}
0