結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 21:24:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 317 bytes |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 66,808 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-07-04 14:01:59 |
| 合計ジャッジ時間 | 1,444 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
コンパイルメッセージ
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;
}