結果
| 問題 | No.638 Sum of "not power of 2" | 
| コンテスト | |
| ユーザー |  ldsyb | 
| 提出日時 | 2018-07-27 21:40:17 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 413 bytes | 
| コンパイル時間 | 1,478 ms | 
| コンパイル使用メモリ | 165,832 KB | 
| 実行使用メモリ | 13,952 KB | 
| 最終ジャッジ日時 | 2024-07-04 21:11:10 | 
| 合計ジャッジ時間 | 5,957 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 2 | 
| other | TLE * 1 -- * 11 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int64_t n;
	cin >> n;
	auto bit_count = [](int64_t x) {
		int64_t r = 0;
		for (; x; x >>= 1)
		{
			r += (x & 1);
		}
		return r;
	};
	for (int64_t a = 1; a < 100000000; a++)
	{
		int64_t b = n - a;
		if ((bit_count(a) == 1) || (bit_count(b) == 1))
		{
			continue;
		}
		cout << a << ' ' << b << endl;
		return 0;
	}
	cout << -1 << endl;
	return 0;
}
            
            
            
        