結果

問題 No.219 巨大数の概算
ユーザー crazybbb3crazybbb3
提出日時 2017-01-16 22:26:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 233 ms / 1,500 ms
コード長 1,845 bytes
コンパイル時間 2,198 ms
コンパイル使用メモリ 75,524 KB
実行使用メモリ 58,792 KB
最終ジャッジ日時 2023-09-25 15:36:17
合計ジャッジ時間 16,734 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 229 ms
56,724 KB
testcase_01 AC 233 ms
56,672 KB
testcase_02 AC 226 ms
56,784 KB
testcase_03 AC 231 ms
56,672 KB
testcase_04 AC 224 ms
56,856 KB
testcase_05 AC 86 ms
52,760 KB
testcase_06 AC 142 ms
54,320 KB
testcase_07 AC 88 ms
54,028 KB
testcase_08 AC 130 ms
54,408 KB
testcase_09 AC 82 ms
52,692 KB
testcase_10 AC 219 ms
56,980 KB
testcase_11 AC 223 ms
56,900 KB
testcase_12 AC 219 ms
56,624 KB
testcase_13 AC 222 ms
56,920 KB
testcase_14 AC 211 ms
56,960 KB
testcase_15 AC 222 ms
56,916 KB
testcase_16 AC 218 ms
57,036 KB
testcase_17 AC 208 ms
56,992 KB
testcase_18 AC 218 ms
56,992 KB
testcase_19 AC 222 ms
56,872 KB
testcase_20 AC 220 ms
56,988 KB
testcase_21 AC 219 ms
57,260 KB
testcase_22 AC 219 ms
56,988 KB
testcase_23 AC 223 ms
56,948 KB
testcase_24 AC 217 ms
57,016 KB
testcase_25 AC 218 ms
56,940 KB
testcase_26 AC 220 ms
56,964 KB
testcase_27 AC 220 ms
56,808 KB
testcase_28 AC 222 ms
56,940 KB
testcase_29 AC 220 ms
56,860 KB
testcase_30 AC 225 ms
56,676 KB
testcase_31 AC 219 ms
56,768 KB
testcase_32 AC 225 ms
56,840 KB
testcase_33 AC 216 ms
56,900 KB
testcase_34 AC 217 ms
56,676 KB
testcase_35 AC 222 ms
57,368 KB
testcase_36 AC 219 ms
56,848 KB
testcase_37 AC 217 ms
56,940 KB
testcase_38 AC 222 ms
56,980 KB
testcase_39 AC 219 ms
56,824 KB
testcase_40 AC 218 ms
56,712 KB
testcase_41 AC 212 ms
56,740 KB
testcase_42 AC 222 ms
57,512 KB
testcase_43 AC 223 ms
56,872 KB
testcase_44 AC 219 ms
58,792 KB
testcase_45 AC 220 ms
56,972 KB
testcase_46 AC 217 ms
56,968 KB
testcase_47 AC 221 ms
57,224 KB
testcase_48 AC 225 ms
56,696 KB
testcase_49 AC 219 ms
57,116 KB
testcase_50 AC 221 ms
56,908 KB
testcase_51 AC 86 ms
52,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {

    void solve() throws IOException {
        int n = ni();
        for (int i = 0; i < n; i++) {
            long a = nl(), b = nl();
            double t = Math.log10(a) * b;
            long ans = (long) Math.pow(10, t - (long) t + 1);

            out.println((ans / 10) + " " + ans % 10 + " " + (long) t);
        }
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}
0