結果

問題 No.219 巨大数の概算
ユーザー hotpepsihotpepsi
提出日時 2015-09-11 00:45:08
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 506 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 53,504 KB
最終ジャッジ日時 2024-04-27 02:10:04
合計ジャッジ時間 1,469 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:17:33: error: ‘log’ was not declared in this scope; did you mean ‘long’?
   17 |                 long double a = log(A) / log(10);
      |                                 ^~~
      |                                 long
main.cpp:19:33: error: ‘floor’ was not declared in this scope
   19 |                 long double c = floor(b);
      |                                 ^~~~~
main.cpp:20:33: error: ‘pow’ was not declared in this scope
   20 |                 long double d = pow(10, b - c);
      |                                 ^~~

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <cstdio>

using namespace std;

int main(int argc, char *argv[])
{
	cout.precision(16);
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		int A, B;
		cin >> A >> B;
		long double a = log(A) / log(10);
		long double b = a * B;
		long double c = floor(b);
		long double d = pow(10, b - c);
		long double e = floor(d);
		long double f = floor((d - e) * 10);
		cout << e << " " << f << " " << c << endl;
	}
	return 0;
}
0