結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int64_t a, b;
    cin >> a >> b;
    long double p = log10(a) * b;
    int64_t z = static_cast<int64_t>(p);
    int64_t x = pow(10, p - z + 1);
    cout << x / 10 << ' ' << x % 10 << ' ' << z << '\n';
  }
  return 0;
}
0