結果
問題 |
No.360 増加門松列
|
ユーザー |
|
提出日時 | 2017-08-03 15:41:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 982 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 84,632 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:23:27 |
合計ジャッジ時間 | 1,693 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 7 |
ソースコード
#include<cstdio> #include<iostream> #include<algorithm> #include<string> #include<queue> #include<vector> #include<functional> #include<cmath> #include<map> #include<stack> #include<set> #include<numeric> #include<limits> #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ll, string> pls; int main() { vector<int> d(7); for (int i = 0; i < 7; i++) cin >> d[i]; sort(d.begin(), d.end()); do { int D[7] = { 0 }, j = 0; bool flag = true; for (auto x : d) { D[j++] = x; } for (int i = 1; i < 6; i++) { int mi = min(D[i], min(D[i - 1], D[i + 1])); int mx = max(D[i],max(D[i-1],D[i+1])); if (!(((mi == D[i]) || (mx == D[i])) && (D[i+1] > D[i-1]))) { flag = false; } } if (flag) { cout << "YES" << endl; return 0; } } while (next_permutation(d.begin(), d.end())); cout << "NO" << endl; return 0; }