結果

問題 No.1337 Fair Otoshidama
ユーザー zumin
提出日時 2021-03-13 18:54:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 65,460 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-15 09:16:24
合計ジャッジ時間 1,549 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main(){
    int x,y,z;
    cin>>x>>y>>z;
    if((x+y+z)%3){
        cout<<"No"<<endl;
        return 0;
    }
    int t=(x+y+z)/3;
    int i,j,k;

    if(t-z>=0){
        j=t-z;
        k=j;
        i=t-x+3*k;
    }else{
        j=2*(t-z);
        k=t-1;
        i=t-x+3*k;
    }
    if(i>=0&&j>=0&&k>=0&&i-3*k==t-x&&-i+2*j==t-y){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}
0