結果

問題 No.998 Four Integers
ユーザー junji_tuat
提出日時 2020-02-28 21:29:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 424 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 73,728 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 23:03:46
合計ジャッジ時間 1,513 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

int main(void) {
	std::vector<int> num(4);
	
	for (int i = 0; i < 4; i++) {
		std::cin >> num.at(i);
	}

	std::sort(num.begin(), num.end());
	int a = 0;
	for (int j = 0; j < 3; j++) {
		if (num.at(j+1) - num.at(j) != 1) {
			a++;
		}
	}
		if (a == 0) {
			std::cout << "Yes" << std::endl;
		}
		else {
			std::cout << "No" << std::endl;
		}
	}


0