結果

問題 No.1366 交換門松列・梅
ユーザー 沙耶花
提出日時 2021-01-29 21:22:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 574 bytes
コンパイル時間 1,539 ms
コンパイル使用メモリ 196,036 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 10:55:11
合計ジャッジ時間 2,075 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000

bool is_kadomatsu(int a,int b,int c){
	if(a==b||b==c||c==a)return false;
	if(b>a&&b>c)return true;
	if(b<a&&b<c)return true;
	return false;
}

int main(){
	
	vector<int> a(3),b(3);
	rep(i,3)cin>>a[i];
	rep(i,3)cin>>b[i];
	
	rep(i,3){
		rep(j,3){
			swap(a[i],b[j]);
			if(is_kadomatsu(a[0],a[1],a[2])&&is_kadomatsu(b[0],b[1],b[2])){
				cout<<"Yes"<<endl;
				return 0;
			}
			swap(a[i],b[j]);
		}
	}
	cout<<"No"<<endl;
	
    return 0;
}
0