結果
| 問題 | No.638 Sum of "not power of 2" |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-18 00:26:30 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 380µs | |
| コード長 | 507 bytes |
| 記録 | |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 71,512 KB |
| 実行使用メモリ | 10,028 KB |
| 最終ジャッジ日時 | 2026-09-18 00:26:40 |
| 合計ジャッジ時間 | 1,586 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
LL n;
int main() {
// freopen("sum.in", "r", stdin);
// freopen("sum.out", "w", stdout);
scanf("%lld", &n);
for (LL a = 1; a <= n; ++a) {
LL b = n - a;
if (__builtin_popcountll(a) != 1 && __builtin_popcountll(b) != 1) {
printf("%lld %lld\n", a, b);
break;
}
if (a >= b) {
puts("-1");
break;
}
}
return 0;
}