結果

問題 No.3177 output only nand problem
ユーザー ks2m
提出日時 2025-06-13 21:25:46
言語 Java
(openjdk 23)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 2,864 ms
コンパイル使用メモリ 76,356 KB
実行使用メモリ 45,876 KB
最終ジャッジ日時 2025-06-13 21:25:55
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

public class Main {
	public static void main(String[] args) throws Exception {
		for (int i = 0; i < 8; i++) {
			int a = i >> 0 & 1;
			int b = i >> 1 & 1;
			int c = i >> 2 & 1;
			int x = nand(nand(a, b), c);
			int y = nand(a, nand(b, c));
			if (x != y) {
				System.out.println(a + " " + b + " " + c);
				return;
			}
		}
	}

	static int nand(int a, int b) {
		if (a == 1 && b == 1) {
			return 0;
		} else {
			return 1;
		}
	}
}
0