結果
| 問題 |
No.219 巨大数の概算
|
| ユーザー |
|
| 提出日時 | 2016-06-22 08:49:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 578 bytes |
| コンパイル時間 | 651 ms |
| コンパイル使用メモリ | 63,420 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 19:16:37 |
| 合計ジャッジ時間 | 12,278 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 51 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:29:12: warning: ‘y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
29 | char x,y;
| ^
main.cpp:29:10: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
29 | char x,y;
| ^
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
int main(){
int n,a,b;
cin>>n;
long long p;
for(int i=0; i<n; ++i){
cin>>a>>b;
double la,lb,lc,ld;
la=log10(a);
lb=la*b;
int ib;
ib=lb;
lc=lb-ib;
ld=ib;
int z;
z=ld;
double d;
d=pow(10,lc);
string s;
s=to_string(d);
int ss;
ss=s.size();
char x,y;
if(ss){
x=s[0];
if(ss>2){
y=s[2];
} else {
y='0';
}
}
cout<<x<<" "<<y<<" "<<z<<endl;
}
return 0;
}