結果
| 問題 | No.638 Sum of "not power of 2" | 
| コンテスト | |
| ユーザー |  tnakao0123 | 
| 提出日時 | 2018-01-30 15:03:10 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 824 bytes | 
| コンパイル時間 | 934 ms | 
| コンパイル使用メモリ | 82,844 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-30 02:56:41 | 
| 合計ジャッジ時間 | 1,601 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 | 
ソースコード
/* -*- coding: utf-8 -*-
 *
 * 638.cc: No.638 Sum of "not power of 2" - yukicoder
 */
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;
/* constant */
/* typedef */
typedef long long ll;
/* global variables */
/* subroutines */
inline bool is_pow2(ll k) {
  while ((k & 1) == 0) k >>= 1;
  return (k == 1);
}
/* main */
int main() {
  ll n;
  cin >> n;
  for (ll a = 3, b = n - a; a <= b; a++, b--)
    if (! is_pow2(a) && ! is_pow2(b)) {
      printf("%lld %lld\n", a, b);
      return 0;
    }
  puts("-1");
  return 0;
}
            
            
            
        