結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-02 10:27:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 353 bytes |
| コンパイル時間 | 607 ms |
| コンパイル使用メモリ | 74,208 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 17:25:36 |
| 合計ジャッジ時間 | 1,700 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
int ceil(int a, int b){
if (a % b){
return a/b + 1;
}else
return a/b;
}
int main(){
int n,x,a,b;
cin >> n >> x >> a >> b;
cout << min({ceil(pow(2,n-1) - x,b), ceil(x,a)}) << endl;
}