結果
| 問題 |
No.820 Power of Two
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-15 20:10:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 731 ms / 2,000 ms |
| コード長 | 1,389 bytes |
| コンパイル時間 | 690 ms |
| コンパイル使用メモリ | 93,412 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-27 15:56:32 |
| 合計ジャッジ時間 | 1,892 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <utility>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define _upgrade ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}
//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
//ll lcm(ll x, ll y) {return x / gcd(x, y) * y;}
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const long double PI = 3.14159265358979323846;
// ****************************************CODE***************************************//
int main(){
int n,k;
cin >> n >> k;
int tmp1 = 1, tmp2 = 1;
for(int i = 0; i < n; i++){
tmp1 *= 2;
}
for(int i = 0; i < k; i++){
tmp2 *= 2;
}
int ans = 0;
for(int i = tmp2; i <= tmp1; i += tmp2){
ans++;
}
cout << ans << endl;
}