結果
| 問題 | No.512 魔法少女の追いかけっこ |
| コンテスト | |
| ユーザー |
taba
|
| 提出日時 | 2017-05-17 22:37:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 423 bytes |
| 記録 | |
| コンパイル時間 | 419 ms |
| コンパイル使用メモリ | 47,232 KB |
| 最終ジャッジ日時 | 2025-01-05 00:18:59 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 53 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d%d",&x,&y,&n);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%lf",&a[i]);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <vector>
using namespace std;
int main(){
int x,y,n;
scanf("%d%d%d",&x,&y,&n);
vector<double> a(n);
for(int i=0;i<n;i++)
scanf("%lf",&a[i]);
bool tf=true;
for(int i=0;i<n-1;i++){
double time=a[i]/x;
float ypos=y*time;
//printf("time=%lf pos=%lf next=%lf test=%d\n",time,ypos,a[i+1],ypos>a[i+1]);
if(ypos>a[i+1]){
tf=false;
break;
}
}
puts(tf?"YES":"NO");
return 0;
}
taba