結果
| 問題 |
No.219 巨大数の概算
|
| コンテスト | |
| ユーザー |
anta
|
| 提出日時 | 2015-05-29 23:35:42 |
| 言語 | Perl (5.40.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,898 bytes |
| コンパイル時間 | 3,130 ms |
| コンパイル使用メモリ | 81,784 KB |
| 最終ジャッジ日時 | 2024-07-18 10:49:13 |
| 合計ジャッジ時間 | 5,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/usr/bin/ld: /tmp/cc1dMQ7Z.o: in function `main': my_tmp.cpp:(.text.startup+0x83): undefined reference to `log10q' /usr/bin/ld: my_tmp.cpp:(.text.startup+0xa5): undefined reference to `floorq' /usr/bin/ld: my_tmp.cpp:(.text.startup+0xd8): undefined reference to `powq' /usr/bin/ld: my_tmp.cpp:(.text.startup+0xea): undefined reference to `floorq' collect2: error: ld returned 1 exit status compile error at Main.pl line 68, <$fh> line 6. BEGIN failed--compilation aborted at Main.pl line 70.
ソースコード
system './' . $exe_name;
BEGIN {
$source_name = 'my_tmp.cpp';
$exe_name = $^O eq 'MSWin32' ? 'my_a.exe' : 'my_a.out';
return if -e $exe_name;
open my $fh, '>', $source_name;
print $fh <<'CODE';
#line 9
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <quadmath.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
using namespace std;
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii; typedef long long ll;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
int main() {
int N;
cin >> N;
rep(ii, N) {
int A, B;
cin >> A >> B;
__float128 t = log10q(__float128(A)) * B;
ll Z = (ll)floorq(t);
int XY = (int)floorq(powq(__float128(10), t - Z) * 10);
printf("%d %d %lld\n", XY / 10, XY % 10, Z);
}
return 0;
}
CODE
system "g++ -m64 -O2 -lm -march=native -std=c++11 -lquadmath $source_name -o $exe_name 2> my_compile.log";
if($? != 0) {
open(my $fh, '<', 'my_compile.log');
while(<$fh>) { print STDERR $_; }
die 'compile error';
}
}
anta