結果
| 問題 | 
                            No.998 Four Integers
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-04-19 20:55:50 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 661 bytes | 
| コンパイル時間 | 425 ms | 
| コンパイル使用メモリ | 56,216 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-06 08:03:42 | 
| 合計ジャッジ時間 | 1,259 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 16 WA * 7 | 
ソースコード
#include <iostream>
using namespace std;
bool sort(int *a, int *b, int *c, int *d) {
    bool result = false;
    int *buf;
    if (a>b) {
        buf = a;
        a = b;
        b = buf;
        result = true;
    }
    if (b>c) {
        buf = b;
        b = c;
        c = buf;
        result = true;
    }
    if (c>d) {
        buf = c;
        c = d;
        d = buf;
        result = true;
    }
    return result;
}
int main () {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    for(;sort(&a,&b,&c,&d);){}
    cerr<<a<<b<<c<<d<<endl;
    if(d-1==c && c-1==b && b-1==a) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
    return 0;
}