結果

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

ソースコード

diff #

#include <iostream>
#include <cmath>

using namespace std;

double l10(double x) {
	return log(x) / log(10);
}

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