結果
問題 | No.219 巨大数の概算 |
ユーザー |
|
提出日時 | 2022-08-24 11:43:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 1,500 ms |
コード長 | 790 bytes |
コンパイル時間 | 1,537 ms |
コンパイル使用メモリ | 166,032 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 21:22:06 |
合計ジャッジ時間 | 4,542 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 51 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){ios::sync_with_stdio(false);cin.tie(0);int T, B;long double A;cin >> T;while(T--){cin >> A >> B;long double x = 1;ll add = 0, y = 0;while(A >= 10){A /= 10;add++;}while(B){if(B & 1){y += add;x *= A;}while(x >= 10){x /= 10;y++;}B >>= 1;A *= A;add += add;while(A >= 10){A /= 10;add++;}}cout << int(x * 10) / 10 << " " << int(x * 10) % 10 << " " << y << '\n';}}