結果
| 問題 |
No.360 増加門松列
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-08-20 20:16:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 708 bytes |
| コンパイル時間 | 1,142 ms |
| コンパイル使用メモリ | 82,472 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 21:37:49 |
| 合計ジャッジ時間 | 1,633 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 9 |
ソースコード
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
bool kadomatsu(int a, int b, int c) {
if(a == b || b == c || c == a) return false;
return a < b && c < b || a > b && c > b;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
vector<int> D(7);
for(int i = 0; i < 7; i++) {
cin >> D[i];
}
sort(D.begin(), D.end());
do {
bool flag = true;
for(int i = 0; i <= 4; i++) {
if(!kadomatsu(D[i], D[i + 1], D[i + 2])) {
flag = false;
break;
}
}
if(flag) {
cout << "YES" << endl;
return 0;
}
} while(next_permutation(D.begin(), D.end()));
cout << "NO" << endl;
}
femto