結果

問題 No.3177 output only nand problem
ユーザー ruase_
提出日時 2025-08-14 20:54:37
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 79,436 KB
実行使用メモリ 7,712 KB
最終ジャッジ日時 2025-08-14 20:54:38
合計ジャッジ時間 1,559 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <tuple>
# include <limits>
using namespace std;


bool Nand(const bool& A, const bool& B) {
	return !(A & B);
}

int main() {
	int a1,a2,a3;
    for(int a = 0; a <= 1; a++)
    {
	  	for(int b = 0; b <= 1; b++)
	  	{
	  		for(int c = 0; c <= 1; c++)
	  		{
	  			if (!(Nand(Nand(a,b),c) == Nand(a,Nand(b,c))))
	  			{
	  				a1 = a;
	  				a2 = b;
	  				a3 = c;
	  			}
	  		}
	  	}
	}
	cout << a1 << " " << a2 << " " << a3 <<endl;
}
0