結果
| 問題 | 
                            No.2063 ±2^k operations (easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-09-02 22:26:58 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 483 bytes | 
| コンパイル時間 | 343 ms | 
| コンパイル使用メモリ | 29,440 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-11-16 04:22:21 | 
| 合計ジャッジ時間 | 1,126 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 21 | 
ソースコード
#include <stdbool.h>
#include <stdio.h>
bool det(unsigned int x)
{
    if (x==0) {
        return false;
    }
    return (x&(x-1))==0;
}
int main(void)
{
    int binary;
    int decimal = 0;
    int base = 1;
 
    scanf("%d", &binary);
 
    while(binary>0){
        decimal = decimal + ( binary % 10 ) * base;
        binary = binary / 10;
        base = base * 2;
        }
        
    printf("%d\n",decimal);
    printf("%s\n",det(decimal)?"No":"Yes");
    return 0;
    
}