結果

問題 No.1298 OR XOR
ユーザー nok0
提出日時 2020-10-18 19:40:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 63,800 KB
最終ジャッジ日時 2025-01-15 11:39:40
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         std::scanf("%d", &n);
      |         ~~~~~~~~~~^~~~~~~~~~

ソースコード

diff #

#include <iostream>

int n, a, b, c;
int main() {
	std::scanf("%d", &n);
	if(n == (n & -n)) {
		std::printf("-1 -1 -1\n");
		return 0;
	}
	a = n, b = n & -n, c = a ^ b;
	printf("%d %d %d\n", a, b, c);
	return 0;
}
0