結果
問題 |
No.219 巨大数の概算
|
ユーザー |
|
提出日時 | 2015-05-30 00:36:00 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 100 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-07-06 12:22:37 |
合計ジャッジ時間 | 11,671 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | RE * 51 |
コンパイルメッセージ
Syntax OK
ソースコード
#!/usr/bin/ruby IO.popen('g++-mp-4.8 -xc++ -std=c++11 -ozzz - -lquadmath','w'){|io| io.puts DATA.read } IO.popen('./zzz','r+'){|io| io.write $<.read io.close_write puts io.read } File.unlink('zzz') __END__ //その他行きでおk☆ ToT #include <vector> #include <algorithm> #include <cstdio> #include <quadmath.h> using namespace std; int main(){ vector<__float128>t(101); for(int i=10;i<101;i++)t[i]=log10q(__float128(i)); int N; for(scanf("%d",&N);N--;){ long long A,B; scanf("%lld%lld",&A,&B); __float128 result=log10q(__float128(A))*B; long long Z=result; result-=Z-1; auto it=upper_bound(t.begin(),t.end(),result);--it; int X=distance(t.begin(),it); printf("%d %d %lld\n",X/10,X%10,Z); } }