結果
問題 |
No.219 巨大数の概算
|
ユーザー |
![]() |
提出日時 | 2015-05-30 00:38:58 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 10 ms / 1,500 ms |
コード長 | 427 bytes |
コンパイル時間 | 272 ms |
コンパイル使用メモリ | 33,408 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 10:56:27 |
合計ジャッジ時間 | 2,680 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 51 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d%d", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> //submitデバッグするマン int main(void) { int n, i; scanf("%d", &n); for(i = 0; i < n; i++) { int a, b; scanf("%d%d", &a, &b); long double d = ( (long double) b) * log10l(a); long long int z = floorl(d); long double base = powl(10, d - floorl(d)); int x = floorl(base), y = ( (int) floorl(base * 10) ) % 10; printf("%d %d %lld\n", x, y, z); } return 0; }