結果
問題 |
No.512 魔法少女の追いかけっこ
|
ユーザー |
![]() |
提出日時 | 2017-07-22 15:52:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 1,229 ms |
コンパイル使用メモリ | 157,632 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 06:40:20 |
合計ジャッジ時間 | 2,445 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 2 | main(){ | ^~~~ main.cpp: In function ‘int main()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d%d%d",&X,&Y,&N); | ~~~~~^~~~~~~~~~~~~~~~~~~ main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%lf",&T[i]); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h> main(){ int X,Y,N; double T[80]; scanf("%d%d%d",&X,&Y,&N); for(int i = 0;i < N;i++){ scanf("%lf",&T[i]); } for(int i = 0;i < N-1;i++){ double time = T[i]/X; if(Y > T[i+1]/T[i]*X){ // if(Y*time > T[i+1]){ printf("NO\n"); return 0; } } printf("YES\n"); }