結果
問題 | No.219 巨大数の概算 |
ユーザー |
![]() |
提出日時 | 2015-10-26 02:15:47 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 673 bytes |
コンパイル時間 | 1,365 ms |
コンパイル使用メモリ | 159,668 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 09:13:40 |
合計ジャッジ時間 | 10,415 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 50 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,a,b) for(int i=(a);i<(b);i++) #define pb push_back #define all(v) (v).begin(),(v).end() typedef vector<int>vi; double pow(int a,int b){ double ret=1; while(b){ if(b&1)ret*=a; a*=a; b>>=1; while(ret>100000)ret/=10; while(a>100000)a/=10; } return ret; } void solve(){ int A,B; cin>>A>>B; double x=pow(A,B); while(x>=100)x/=10; int y=x; cout<<y/10<<" "<<y%10<<" "<<(int)(log10(A)*B)<<endl; } signed main(){ int N; cin>>N; while(N--)solve(); return 0; }