結果

問題 No.780 オフ会
ユーザー SHuuuuuuuuuuuuA
提出日時 2019-01-19 16:37:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 54,448 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 01:01:56
合計ジャッジ時間 1,110 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int people[2];
    cin >> people[0] >> people[1];

    if (people[0]+1 == people[1]) {
        cout << "YES" << endl;
        cout << 0 << endl;
    } else if (people[0]+1 > people[1]) {
        cout << "NO" << endl;
        cout << people[0]+1 - people[1] << endl;
    } else if (people[0]+1 < people[1]) {
        cout << "YES" << endl;
        cout << people[1] - (people[0]+1) << endl;
    }
    return 0;
}
0