結果
| 問題 | No.512 魔法少女の追いかけっこ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 22:32:44 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-27 05:56:15 |
| 合計ジャッジ時間 | 1,498 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 WA * 22 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:17: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double *’ [-Wformat=]
6 | scanf("%f %f",&x,&y);
| ~^ ~~
| | |
| | double *
| float *
| %lf
main.c:6:20: warning: format ‘%f’ expects argument of type ‘float *’, but argument 3 has type ‘double *’ [-Wformat=]
6 | scanf("%f %f",&x,&y);
| ~^ ~~
| | |
| | double *
| float *
| %lf
main.c:9:25: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double *’ [-Wformat=]
9 | scanf("%f",&a[i]);
| ~^ ~~~~~
| | |
| | double *
| float *
| %lf
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%f %f",&x,&y);
| ^~~~~~~~~~~~~~~~~~~~
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%f",&a[i]);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(int argc, char const *argv[]){
double x,y,a[80];
int n,i;
scanf("%f %f",&x,&y);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%f",&a[i]);
if(i>0){
if(a[i-1]*y/x>a[i]){
printf("NO\n");
return 0;
}
}
}
printf("YES\n");
return 0;
}