結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-19 20:58:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 707 bytes |
| コンパイル時間 | 436 ms |
| コンパイル使用メモリ | 55,472 KB |
| 実行使用メモリ | 16,832 KB |
| 最終ジャッジ日時 | 2024-10-06 08:04:25 |
| 合計ジャッジ時間 | 4,745 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 1 |
| other | -- * 23 |
ソースコード
#include <iostream>
using namespace std;
bool sort(int *a, int *b, int *c, int *d) {
cerr<<"sort"<<*a<<*b<<*c<<*d<<endl;
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;
}