結果
問題 | 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 |
コンパイル時間 | 2,007 ms |
コンパイル使用メモリ | 193,928 KB |
最終ジャッジ日時 | 2025-01-18 08:45:21 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <stdio.h>#include <bits/stdc++.h>using namespace std;#define rep(i,n) for (int i = 0; i < (n); ++i)#define Inf 1000000000bool 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;}