結果
| 問題 | 
                            No.1372 Median of Submasks
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-02-06 13:04:39 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 627 bytes | 
| コンパイル時間 | 710 ms | 
| コンパイル使用メモリ | 81,044 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-02 21:07:43 | 
| 合計ジャッジ時間 | 1,635 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 23 WA * 1 | 
ソースコード
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <map>
#include <utility>
#include <list>
#include <math.h>
#include <algorithm>
#include <bitset>
using namespace std;
/*
int binary(int a){
    for (int i=0;a>0;i++)
    {
        ans=ans+(a%2)*pow(10,i);
        a=a/2;
    }
    return ans;
}*/
int main(){
    long long n;
    cin>>n;
    long long ans;
    long long cnt=1;
    for(long long i=0;;i++)
    {
      cnt++;
      if(n>=pow(2,i)&&pow(2,i+1)>n)
      {
          break;
        }
    }
    if(n==1)cout<<1<<endl;
    else cout<<((long long)1<<(cnt-2))<<endl;
    return 0;
}