結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-24 23:01:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,177 bytes |
| コンパイル時間 | 812 ms |
| コンパイル使用メモリ | 88,308 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 01:50:55 |
| 合計ジャッジ時間 | 1,784 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
using namespace std;
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define p(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1<<25
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef long long ll;
//int dy[8]={1,1,1,0,0,-1,-1,-1};
//int dx[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct S{
int a,b,c;
};
bool asc(const S& left,const S& right){
return left.c > right.c;
}
int N,M,l,r,X,A,B;
void input(){
cin>>N>>X>>A>>B;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
input();
int b=((1<<(N-1))-X)/B;
if(((1<<(N-1))-X)%B!=0)b++;
int a=X/A;
if(X%A!=0)a++;
P(min(a,b))
return 0;
}