結果
問題 | No.998 Four Integers |
ユーザー |
|
提出日時 | 2020-03-20 15:56:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 1,865 ms |
コンパイル使用メモリ | 172,200 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 07:47:16 |
合計ジャッジ時間 | 2,790 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> x(4); for(int i = 0; i < 4; i++) cin >> x[i]; sort(x.begin(), x.end()); bool ans = false; do{ if(x[0] + 1 == x[1] && x[0] + 2 == x[2] && x[0] + 3 == x[3]){ ans = true; } }while(next_permutation(x.begin(), x.end())); if(ans) cout << "Yes" << endl; else cout << "No" << endl; }