結果

問題 No.219 巨大数の概算
ユーザー Mister
提出日時 2020-08-18 08:51:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 18 ms / 1,500 ms
コード長 555 bytes
コンパイル時間 952 ms
コンパイル使用メモリ 78,816 KB
最終ジャッジ日時 2025-01-13 02:53:37
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    while (n--) {
        ldouble a, b;
        std::cin >> a >> b;

        auto p = b * std::log10(a);
        lint z = std::llround(std::floor(p));
        p -= z;
        int xy = std::lround(std::floor(std::pow(10, p) * 10));
        std::cout << xy / 10 << " " << xy % 10 << " " << z << "\n";
    }
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0