結果

問題 No.780 オフ会
ユーザー dgd1724
提出日時 2019-03-31 19:51:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 56,864 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 06:50:28
合計ジャッジ時間 1,421 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <fstream>
#include <iostream>
#include <string>


int main() {

	//std::ifstream inf("Text.txt");	std::cin.rdbuf(inf.rdbuf());

	int A, B;
	std::cin >> A >> B;

	if (B - A == 1) {
		std::cout << "YES" << std::endl;
	}
	else {
		std::cout << "NO" << std::endl;
	}

	if (A < B) {
		std::cout << B - A - 1 << std::endl;
	}
	else if (A > B) {
		std::cout << A - B + 1 << std::endl;
	}
	else {
		std::cout << '1' << std::endl;
	}

	return 0;

}
0