結果

問題 No.638 Sum of "not power of 2"
ユーザー rgnerdplayer
提出日時 2025-05-01 02:39:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 3,654 ms
コンパイル使用メモリ 272,332 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-05-01 02:39:50
合計ジャッジ時間 4,414 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using i64 = long long;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    auto solve = [&]() {
        i64 n;
        cin >> n;

        for (i64 i = 1; i < n; i++) {
            if (__builtin_popcount(i) != 1 && __builtin_popcount(n - i) != 1) {
                cout << i << ' ' << n - i << '\n';
                return;
            }
        }

        cout << -1 << '\n';
    };
    
    solve();
    
    return 0;
}
0