結果

問題 No.1934 Four Fruits
ユーザー momotaro1303momotaro1303
提出日時 2022-06-06 00:01:40
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,240 bytes
コンパイル時間 2,687 ms
コンパイル使用メモリ 215,916 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 03:21:53
合計ジャッジ時間 3,391 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> PP;
typedef tuple<ll,ll,ll> TTT;
const ll mod=1e9+7,INF=mod*mod*3;
//M_PI 998244353
#define rep(i,N) for(ll i=0; i<(N); i++)
#define rep1(i,N) for(ll i=1; i<(N); i++)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define si(x) x.size()
#define debug(x,y) cout<<x<<" "<<y<<endl;
#define add(x,y) (x=(x+y)%mod)
#define sub(x,y) (x=(x-y+mod)%mod)
#define mult(x,y) (x=(x*y)%mod)
template<class T> 
inline bool chmax(T &a,const T &b){
  if(a<b) {a=b;return 1;}
  return 0;
}
template<class T> 
inline bool chmin(T &a,const T &b){
  if(b<a) {a=b;return 1;}
  return 0;
}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
// a + b がオーバーフローするならtrueを返す
template <class T> bool overflow_if_add(T a, T b) {
    return (std::numeric_limits<T>::max() - a) < b;
}
// a * b がオーバーフローするならtrueを返す
template <class T> bool overflow_if_mul(T a, T b) {
    return (std::numeric_limits<T>::max() / a) < b;
}
ll mod_inverse(ll a) {
    ll ret=1L;
    ll m=1e9+5L;
    while(m){
      if(m%2){
        ret=(ret*a)%mod;
      }
      m=m/2;
      a=(a*a)%mod;
    }
    return ret;
}
const ll sze=2000005;
ll fc[sze],fv[sze];
ll cb(ll n,ll r){
  ll ret=0;
  ret=fc[n]*fv[n-r]%mod*fv[r]%mod;
  return ret;
}
ll pw(ll x,ll y){
    ll ret=1;
    for(ll i=0; i<y; i++) ret=ret*x;
    return ret;
}
ll ctoi(char c) {
  if(c>='0'&&c<='9'){
    return c-'0';
  }
  return 0;
}
ll gcd(ll a,ll b){
if(a<b) swap(a,b);
if(a%b==0) return b;
else return gcd(a%b,b);
}

#ifdef LOCAL
#define DBG(X,Y) debug(X,Y);
#define SAY(X) cout<<(X)<<endl;
#else
#define DBG(X,Y)
#define SAY(X)
#endif

ll a,b,c;

void slv(){

cin>>a>>b>>c;
if(a==b&&b==c){
  cout<<a<<endl;
}
else if(a!=b&&a!=c&&b!=c){
  cout<<6-(a+b+c)<<endl;
}
else{
  if(a==b) cout<<c<<endl;
  if(a==c) cout<<b<<endl;
  if(b==c) cout<<a<<endl;
}


}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
//ll t;cin>>t;rep(_,t)
slv();
}



    
0