結果

問題 No.1366 交換門松列・梅
ユーザー private-dev-acctprivate-dev-acct
提出日時 2021-05-05 13:15:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,722 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 201,756 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-07-30 09:06:53
合計ジャッジ時間 2,882 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

#define _CRT_SECURE_NO_WARINGS
#define INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define SORT(obj) sort(ALL(obj))
#define RSORT(obj) sort(RALL(obj))
#define REP(i,n) for(int i = 0; i < (n); ++i)
#define COUT_ALL(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<" ";cout<<*--x.end()<<endl;

using ll = long long;
using P = pair<int, int>;
using VI = vector<int>;
using VP = vector<P>;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double PI = 3.14159265358979323846;

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {for (T& x : vec) is >> x;return is;}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec) {
	for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : " "); }
	return os;}


#pragma region F
bool f(vector<int>a) {
	if (a[0] == a[1] || a[1] == a[2] || a[0] == a[2])return false;
	if ((a[1] > a[0] && a[1] > a[2]) || (a[1] < a[0] && a[1] < a[2]))return true;
	else return false;
}
#pragma endregion




signed main()
{
	INIT; // 必須

	vector<int>a(3), b(3);
	for (int i = 0; i < 3; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < 3; i++) {
		cin >> b[i];
	}
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			swap(a[i], b[j]);
			if (f(a) && f(b)) {
				cout << "Yes" << endl; return 0;
			}
			swap(a[i], b[j]);
		}
	}
	cout << "No" << endl;
	return 0;
}
0