結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 21:23:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 313 bytes |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 69,236 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 11:54:04 |
| 合計ジャッジ時間 | 1,514 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 10 |
コンパイルメッセージ
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;
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;
}