結果

問題 No.1934 Four Fruits
ユーザー orange navleorange navle
提出日時 2022-05-13 21:38:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,215 bytes
コンパイル時間 2,251 ms
コンパイル使用メモリ 213,800 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-29 06:39:21
合計ジャッジ時間 2,945 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef long double LD;

#define rep(i,n) for(LL i=0;i<(n);i++)

template <class T>
void output(vector<T> &data){

    rep(i,data.size()){
        cout << data.at(i) << " ";
    }
    cout << endl;

}

template<>
void output(vector<string> &data){
 
    rep(i,data.size()){
        cout << data.at(i) << endl;
    }
 
}

template <class T>
void output(vector<vector<T>> &data){

    rep(i,data.size()){

        rep(j,data.at(i).size()){
            cout << data.at(i).at(j) << " ";
        }

        cout << endl;

    }

}

template <>
void output(vector<vector<bool>> &data){

    rep(i,data.size()){

        rep(j,data.at(i).size()){

            if(data.at(i).at(j)){
                cout << "*";
            }
            else{
                cout << "-";
            }

        }

        cout << endl;

    }

}

template<class T>
void input(vector<T> &data,LL n){
    
    rep(i,n){
        LL a; cin >> a;
        data.push_back(a);
    }

}

template<>
void input(vector<string> &data,LL n){

    rep(i,n){
        string s; cin >> s;
        data.push_back(s);
    }

}

template<class T>
void input(vector<vector<T>> &data,LL h, LL w){

    rep(i,h){
        vector<T> add;

        rep(j,w){
            T a; cin >> a;
            add.push_back(a);
        }

        data.push_back(add);

    }

}

int main(){
    set<int> data;
    map<int,int> check;

    rep(i,3){
        int a; cin >> a;
        check[a]++;
        data.insert(a);
    }

    int ans = 0;

    if(data.size() == 1){

        for(auto itr=check.begin(); itr!=check.end(); itr++){
            if(itr->second == 3){
                ans = itr->first;
                break;
            }
        }

    }
    else if(data.size() == 2){

        for(auto itr=check.begin(); itr!=check.end(); itr++){
            if(itr->second == 1){
                ans = itr->first;
                break;
            }
        }

    }
    else{

        for(auto itr=check.begin(); itr!=check.end(); itr++){
            if(itr->second == 0){
                ans = itr->first;
                break;
            }
        }

    }

    cout << ans << endl;

    return 0;
}
0