結果
| 問題 | No.820 Power of Two |
| コンテスト | |
| ユーザー |
@abcde
|
| 提出日時 | 2019-05-04 21:40:24 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 550µs | |
| コード長 | 324 bytes |
| 記録 | |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 177,700 KB |
| 実行使用メモリ | 9,736 KB |
| 最終ジャッジ日時 | 2026-10-13 03:57:57 |
| 合計ジャッジ時間 | 2,134 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
// 1. 入力情報取得.
int N, K;
cin >> N >> K;
// 2. x の 個数は?
LL ans = (N >= K) ? 1 : 0;
for(int i = K; i < N; i++) ans <<= 1;
// 3. 後処理.
cout << ans << endl;
return 0;
}
@abcde