結果

問題 No.998 Four Integers
ユーザー warm4C0
提出日時 2022-07-31 20:11:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 309 bytes
コンパイル時間 2,196 ms
コンパイル使用メモリ 159,156 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-21 01:50:48
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	int x[] = {a, b, c, d};
	sort(x, x+4);

	bool ok = true;
	for (int i = 0; i < 3; i++) {
		if (x[i]+1 != x[i+1]) {
			ok = false;
		}
	}

	if (ok) {
		puts("Yes");
	} else {
		puts("No");
	}

	return 0;
}
0