結果

問題 No.598 オーバーフローファンタジー
ユーザー waura
提出日時 2017-11-24 22:48:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 5,712 ms
コンパイル使用メモリ 74,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 01:46:56
合計ジャッジ時間 3,005 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <climits>
#include <cmath>
#include <algorithm>

#define TEST_ASSERT(msg, cond) do { if (cond) { cout << msg << " => pass" << endl;} else { cout << msg << " => failed" << endl;} } while(0)

using namespace std;

int main() {

  int N;
  cin >> N;
  int X;
  cin >> X;
  int A;
  cin >> A;
  int B;
  cin >> B;

  cout << static_cast<int>(ceil(min(static_cast<double>(X)/A, (pow(2.0, N-1)-X)/B))) << endl;

  return 0;
}
0