結果

問題 No.219 巨大数の概算
ユーザー koba-e964koba-e964
提出日時 2015-05-29 23:30:50
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 26 ms / 1,500 ms
コード長 987 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 87,992 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 10:47:44
合計ジャッジ時間 3,574 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef pair<int, int> PI;
const double EPS=1e-9;



int main(void){
  int n;
  cin >> n;
  REP(i, 0, n) {
    ll a, b;
    cin >> a >> b;
    double log_a = log(a) / log(10);
    ll e_a = floor(log_a);
    log_a -= e_a;

    log_a *= b;
    e_a *= b;

    ll t = floor(log_a);
    e_a += t;
    log_a -= t;

    log_a = pow(10, log_a);
    log_a += 1e-9;
    cout << (int)log_a << " " << ((int)(log_a * 10) % 10) << " " << e_a << endl;
  }
}
0