結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-05 13:37:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 276 bytes |
| コンパイル時間 | 486 ms |
| コンパイル使用メモリ | 64,040 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 01:49:53 |
| 合計ジャッジ時間 | 1,655 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include<iostream>
using namespace std;
int main(){
int n, x, a, b;
cin >> n >> x >> a >> b;
int max = 1<<(n-1);
int attack = x/a + (x%a == 0 ? 0 : 1);
int heal = (max-x)/b + ((max-x)%b == 0 ? 0 : 1);
cout << min(attack,heal) << endl;
return 0;
}