結果
| 問題 | 
                            No.820 Power of Two
                             | 
                    
| コンテスト | |
| ユーザー | 
                             numatanumanuma
                         | 
                    
| 提出日時 | 2019-06-14 02:38:50 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 449 bytes | 
| コンパイル時間 | 1,187 ms | 
| コンパイル使用メモリ | 159,676 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-06 14:03:19 | 
| 合計ジャッジ時間 | 1,728 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 WA * 6 | 
ソースコード
//(・∀・)ノ
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define print(s) cout<<(s)<<endl
int main() {
    int N, K;
    cin >> N >> K;
    if (N < K){
        print(0);
    }else{
        if (K == 0){
            ll ans = pow(2, N);
            print(ans);
        }else{
            print(N - K + 2);
        }
    }
    return 0;
}
            
            
            
        
            
numatanumanuma