結果
| 問題 |
No.1366 交換門松列・梅
|
| コンテスト | |
| ユーザー |
noritake
|
| 提出日時 | 2021-01-29 21:49:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,833 bytes |
| コンパイル時間 | 1,361 ms |
| コンパイル使用メモリ | 164,328 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-20 10:56:57 |
| 合計ジャッジ時間 | 1,842 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
// #include <atcoder/all> // NOTE: AtCoderライブラリ
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl;
#define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;
#define nl() cout << "========================================" << endl;
using namespace std;
// using namespace atcoder; // NOTE: AtCoderライブラリ
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<vector<long long>> vvl;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }
#define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn;
bool f(vi x) {
if (x[0] == x[1] || x[1] == x[2] || x[0] == x[2]) return false;
int xmax = *max_element(x.begin(), x.end());
int xmin = *min_element(x.begin(), x.end());
if (x[1] == xmax || x[1] == xmin) return true;
else return false;
}
int main() {
vi A(3); rep(i, 3) cin >> A[i];
vi B(3); rep(i, 3) cin >> B[i];
rep(i, 3) {
rep(j, 3) {
vi A2 = A;
vi B2 = B;
swap(A2[i], B2[j]);
bool ok = f(A2);
ok = f(B2) && ok;
if (ok) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
}
noritake