結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-19 20:54:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 633 bytes |
| コンパイル時間 | 439 ms |
| コンパイル使用メモリ | 56,092 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-06 08:03:35 |
| 合計ジャッジ時間 | 1,416 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / 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);){}
if(d-1==c && c-1==b && b-1==a) {
cout<<"Yes"<<endl;
} else {
cout<<"No"<<endl;
}
return 0;
}