結果

問題 No.1934 Four Fruits
ユーザー abap34abap34
提出日時 2022-05-13 21:39:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 747 bytes
コンパイル時間 3,714 ms
コンパイル使用メモリ 228,084 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 06:42:00
合計ジャッジ時間 4,365 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a)  (a).begin(),(a).end()

int main(){
    vector<int> A(3);
    cin >> A[0] >> A[1] >> A[2];
    sort(ALL(A));
    if (A[0] == A[2]){
        cout << A[0] << endl;
    } else {
        if ((A[0] == A[1]) || (A[1] == A[2])){ 
            if (A[0] == A[1]){
                cout << A[2] << endl;
            } else {
                cout << A[0] << endl;
            }
        } else {
            rep(i, 3){
                if (A[i] != i){
                    cout << i << endl;
                    return 0;
                }
            }
            cout << 3 << endl;
            return 0;
        } 

    }
}
0