結果

問題 No.219 巨大数の概算
ユーザー BantakoBantako
提出日時 2017-08-24 13:26:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 655 bytes
コンパイル時間 2,206 ms
コンパイル使用メモリ 164,276 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-05 17:13:34
合計ジャッジ時間 8,364 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
4,380 KB
testcase_01 AC 59 ms
4,380 KB
testcase_02 AC 59 ms
4,380 KB
testcase_03 AC 60 ms
4,380 KB
testcase_04 AC 44 ms
4,384 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 60 ms
4,380 KB
testcase_11 AC 59 ms
4,380 KB
testcase_12 AC 62 ms
4,376 KB
testcase_13 AC 59 ms
4,376 KB
testcase_14 AC 61 ms
4,376 KB
testcase_15 AC 60 ms
4,376 KB
testcase_16 AC 60 ms
4,380 KB
testcase_17 AC 60 ms
4,376 KB
testcase_18 AC 60 ms
4,376 KB
testcase_19 AC 60 ms
4,376 KB
testcase_20 AC 60 ms
4,380 KB
testcase_21 AC 59 ms
4,376 KB
testcase_22 AC 59 ms
4,380 KB
testcase_23 AC 59 ms
4,376 KB
testcase_24 AC 59 ms
4,376 KB
testcase_25 AC 58 ms
4,380 KB
testcase_26 AC 59 ms
4,376 KB
testcase_27 AC 59 ms
4,376 KB
testcase_28 WA -
testcase_29 AC 55 ms
4,380 KB
testcase_30 AC 56 ms
4,380 KB
testcase_31 AC 56 ms
4,376 KB
testcase_32 AC 58 ms
4,376 KB
testcase_33 AC 57 ms
4,376 KB
testcase_34 AC 58 ms
4,376 KB
testcase_35 AC 58 ms
4,376 KB
testcase_36 AC 56 ms
4,376 KB
testcase_37 AC 60 ms
4,376 KB
testcase_38 AC 61 ms
4,376 KB
testcase_39 AC 55 ms
4,376 KB
testcase_40 AC 55 ms
4,376 KB
testcase_41 AC 55 ms
4,380 KB
testcase_42 AC 59 ms
4,380 KB
testcase_43 AC 55 ms
4,376 KB
testcase_44 AC 55 ms
4,376 KB
testcase_45 AC 57 ms
4,376 KB
testcase_46 AC 55 ms
4,376 KB
testcase_47 AC 59 ms
4,376 KB
testcase_48 AC 57 ms
4,380 KB
testcase_49 AC 57 ms
4,376 KB
testcase_50 AC 57 ms
4,380 KB
testcase_51 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:14:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   14 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1000000007;
double power(double x,ll n){
    if(n == 0)return 1;
    x /= pow(10,floor(log10(x))); 
    double ans = power(x*x,n/2);
    if(n % 2 == 1)ans *= x;
    ans /= pow(10,floor(log10(ans))); 
    return ans;
}
main(){
    int N;
    cin >> N;
    for(int i = 0;i < N;i++){
        ll A,B;
        cin >> A >> B;
        double digit = log10(A);
        double d = 1.*A/pow(10,floor(digit));
        double ans = power(d,B);
//        cout << d << " " << ans << endl;
        printf("%d %d %lld\n",(int)ans,(int)(ans*10)%10,(ll)(floor(digit*B)));
    }  
}
0