結果
| 問題 | No.219 巨大数の概算 |
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-16 09:33:56 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 490 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 08:10:06 |
| 合計ジャッジ時間 | 8,661 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 51 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
main.c:20:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | scanf("%lf %lf", &a, &b);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
TLwiegehtt