結果

問題 No.680 作れる数
ユーザー vjudge1
提出日時 2025-09-20 18:37:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
OLE  
実行時間 -
コード長 600 bytes
コンパイル時間 1,390 ms
コンパイル使用メモリ 155,976 KB
実行使用メモリ 11,936 KB
最終ジャッジ日時 2025-09-20 18:38:07
合計ジャッジ時間 8,291 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other OLE * 2 -- * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:9: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |  freopen("gen.in", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
signed main()
{
    //
 freopen("gen.in", "r", stdin);
    // freopen("gen.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T;
    cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        bool f = 1;
        for (int i = 30; i >= 0; i--)
        {
            if (i == __builtin_popcount(n + i))
            {
                puts("YES");
                f = 0;
                break;
            }
        }
        if (f)
            puts("NO");
    }
}
0