結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-24 22:32:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 406 bytes |
| コンパイル時間 | 833 ms |
| コンパイル使用メモリ | 66,220 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 01:37:06 |
| 合計ジャッジ時間 | 1,875 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#define MP make_pair
using ll = long long;
using namespace std;
int main()
{
int N;
ll X, A, B;
cin >> N;
cin >> X >> A >> B;
ll max = pow(2, N-1) -1;
ll n1 = (max - X) / B + 1;
ll n2 = X / A;
if(X%A != 0)
n2++;
cout << min(n1, n2) << endl;
return 0;
}