結果

問題 No.1298 OR XOR
ユーザー Izayoi_R_sakura
提出日時 2020-11-27 21:28:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,285 bytes
コンパイル時間 1,162 ms
コンパイル使用メモリ 123,084 KB
最終ジャッジ日時 2025-01-16 06:27:39
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1e9+7 ;
long double pie = acos(-1) ;
ll INF = 1000000000000 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T &b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T &b){if(a>b) a = b ;}

int main(){
	ll n ; cin >> n ;
	bool ok = false ;
	for(int i=0;i<35;i++) if(n==(1ll<<i)) ok = true ;
	if(ok) cout << "-1 -1 -1" << endl ;
	else{
		for(int i=0;i<35;i++){
			if((n>>i)&1){
				cout << n << " " << (1ll<<i) << " " << n-(1ll<<i) << endl ;
				return 0 ;
			}
		}
	} 
}
0