結果

問題 No.219 巨大数の概算
ユーザー 158b
提出日時 2015-06-04 18:11:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 25 ms / 1,500 ms
コード長 756 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 73,736 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 11:13:53
合計ジャッジ時間 3,591 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
using namespace std;
//ans 9 4 16594101793

int main(){
	int n;
	long long a[10000],b[10000];
	double keta,ans;	//double
	long long ans1,ans2,ans3;


	cin >> n;
	for(int i=0; i<n; i++){
		cin >> a[i] >> b[i];
	}
	

	/*
	n=1;
	a[0] = 502810717;
	b[0] = 1907060147;
	*/
	

	for(int i=0; i<n; i++){
		//桁数(double)求める
		keta = log10(a[i])*b[i];
		ans3 = floor(keta);
		
		//X.Yを求める
		ans = pow(10, keta - floor(keta));
		ans1 = floor(ans);
		ans *= 10;
		ans2 = int(floor(ans)) % 10;
		
		//合ってるといいな
		cout << ans1 << " " << ans2 << " " << ans3 << endl;
	}

	return 0;
}
0