結果
問題 |
No.1736 Princess vs. Dragoness
|
ユーザー |
|
提出日時 | 2021-11-12 21:24:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 317 bytes |
コンパイル時間 | 830 ms |
コンパイル使用メモリ | 70,124 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 11:56:11 |
合計ジャッジ時間 | 1,700 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> using namespace std; int N,A,B,X,Y; int H[3000]; main() { cin>>N>>A>>B>>X>>Y; long all=(long)Y*B; for(int i=0;i<N;i++) { cin>>H[i]; while(A>0&&H[i]>=X)H[i]-=X,A--; all-=H[i]; } sort(H,H+N); for(int i=0;i<A&&i<N;i++)all+=H[N-i-1]; cout<<(all<0?"No":"Yes")<<endl; }