結果
問題 |
No.219 巨大数の概算
|
ユーザー |
![]() |
提出日時 | 2015-07-16 04:45:33 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 510 bytes |
コンパイル時間 | 210 ms |
コンパイル使用メモリ | 24,448 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 08:08:21 |
合計ジャッジ時間 | 9,032 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 51 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &n); | ^~~~~~~~~~~~~~~ main.c:21:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%lf %lf", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <string.h> #include <math.h> #include <stdio.h> int main(void) { int i,j,n; double list[111] ; for(i=10;i<100;i++){ list[i] = log10(1.0*i/10); } scanf("%d", &n); for(i=0;i<n;i++){ int s=1, t=0,digit; double tmp,a,b,y; scanf("%lf %lf", &a, &b); y = log10(a)*b; digit = (int)floor(y); tmp = y-floor(y); for(j=11;j<100;j++){ if(list[j] >= tmp){ s = (j-1)/10; t = (j-1)%10; break; } } printf("%d %d %d\n", s,t, digit); } return 0; }