結果
問題 | No.512 魔法少女の追いかけっこ |
ユーザー |
![]() |
提出日時 | 2017-05-05 22:30:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 249 ms |
コンパイル使用メモリ | 37,376 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 05:54:54 |
合計ジャッジ時間 | 1,547 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:19:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | for(i=0;i<n;i++) scanf("%d", &a[i]); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include<cstdio>#include<vector>using namespace std;using vi=vector<int>;int main(void){int x, y, n, i;vi a;while(scanf("%d%d%d", &x, &y, &n)==3){a.resize(n);for(i=0;i<n;i++) scanf("%d", &a[i]);for(i=0;i+1<n;i++){if(y*a[i]>x*a[i+1]) break;}printf("%s\n", (i+1<n)?"NO":"YES");}return 0;}