結果
問題 |
No.820 Power of Two
|
ユーザー |
|
提出日時 | 2019-05-28 18:16:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 890 bytes |
コンパイル時間 | 1,875 ms |
コンパイル使用メモリ | 163,236 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 15:47:05 |
合計ジャッジ時間 | 2,389 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
//↓template↓ #include "bits/stdc++.h" using namespace std; #define Would #define you #define all(n) n.begin(),n.end() const long long INF = 1e18; const long long MOD = 1e9 + 7; const double pi = acos(-1); const long long SIZE = 1 << 17; int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30]; long long fac[200005], finv[200005], inv[200005]; vector<long long>dij; struct edge { long long to, cost; }; vector<vector<edge> >G; long long mod_pow(long long a, long long b) { long long res = 1, mul = a; for (int i = 0; i < 31; ++i) { if (b >> i & 1) { res *= mul; res %= MOD; } mul = (mul * mul) % MOD; } return res; } void addedge(int from, int to, int cost) { G[from].push_back({ to,cost }); G[to].push_back({ from,cost }); } //↑template↑ long long ans = 0; int main() { int a, b; cin >> a >> b; if (a >= b) { ans = pow(2, a - b); } cout << ans << endl; }