結果

問題 No.219 巨大数の概算
ユーザー data9824
提出日時 2015-05-29 23:41:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 29 ms / 1,500 ms
コード長 419 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 60,788 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 10:50:03
合計ジャッジ時間 3,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

using namespace std;

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int a, b;
		cin >> a >> b;
		long double bLogA = b * log10((long double)a);
		long double z = floor(bLogA);
		long double xy = pow((long double)10, bLogA - z);
		int x = (int)floor(xy);
		int y = (int)floor(xy * 10) % 10;
		cout << x << " " << y << " " << (long long)z << endl;
	}
	return 0;
}
0