結果
問題 | No.1366 交換門松列・梅 |
ユーザー | tomo0608 |
提出日時 | 2021-01-29 21:32:46 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 3,696 bytes |
コンパイル時間 | 2,176 ms |
コンパイル使用メモリ | 212,576 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-16 13:16:44 |
合計ジャッジ時間 | 2,721 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,816 KB |
testcase_02 | AC | 2 ms
6,816 KB |
testcase_03 | AC | 2 ms
6,816 KB |
testcase_04 | AC | 2 ms
6,820 KB |
testcase_05 | AC | 2 ms
6,820 KB |
testcase_06 | AC | 2 ms
6,820 KB |
testcase_07 | AC | 2 ms
6,820 KB |
testcase_08 | AC | 2 ms
6,820 KB |
testcase_09 | AC | 2 ms
6,820 KB |
testcase_10 | AC | 1 ms
6,820 KB |
testcase_11 | AC | 1 ms
6,820 KB |
testcase_12 | AC | 2 ms
6,816 KB |
testcase_13 | AC | 1 ms
6,816 KB |
ソースコード
/** * author: tomo0608 * created: 29.01.2021 21:28:13 **/ #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<long long, long long> pll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<vll> vvl; typedef vector<bool> vb; #define all(x) x.begin(),x.end() #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define unique(a) a.erase(unique(a.begin(),a.end()),a.end()) template<class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T> >; template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T> inline bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } template<class T1, class T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; } template<class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template<class T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; } template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; } template<typename T> ostream& operator << (ostream& os, set<T>& set_var) {os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {os << *itr;++itr;if(itr != set_var.end()) os << ", ";itr--;}os << "}";return os;} template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) {os << "{";for(auto itr = map_var.begin(); itr != map_var.end(); itr++) {os << *itr;itr++;if (itr != map_var.end()) os << ", ";itr--;}os << "}";return os;} template<class T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r) #define pb push_back #define eb emplace_back #define elif else if #define mp make_pair #define endl '\n' // Primality test class Prime { public: const int N; vector<int> min_prime; vector<int> primes; Prime(int size): N(size), min_prime(N+1){ rep(i,N+1)min_prime[i] = i; min_prime[0] = -1; min_prime[1] = -1; for(int i = 2;i<=N;i++){ if(min_prime[i]!=i)continue; primes.push_back(i); int tmp = 2*i; while(tmp <= N){ if(min_prime[tmp]==tmp)min_prime[tmp] = i; tmp += i; } } } bool check(int x){ return min_prime[x] == x;} }; template<typename T> // int or long long T gcd(T x, T y){ if(x%y == 0)return y; return gcd(y, x%y); } template<typename T> T gcd(vector<T> a){ T res = a[0]; for(auto &x: a)res = gcd(res, x); return res; } void solve(){ vi a(3),b(3);cin >> a >> b; rep(i,3)rep(j,3){ swap(a[i],b[j]); bool c1 = false, c2 = false; if(a[0] < a[1] && a[2] < a[1] && a[0] != a[2])c1 = true; if(a[0] > a[1] && a[2] > a[1] && a[0] != a[2])c1 = true; if(b[0] < b[1] && b[2] < b[1] && b[0] != b[2])c2 = true; if(b[0] > b[1] && b[2] > b[1] && b[0] != b[2])c2 = true; if(c1 && c2){ cout << "Yes" << endl; return; } swap(a[i],b[j]); } cout << "No" << endl; return; } int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << setprecision(20); int codeforces = 1; //cin >> codeforces; while(codeforces--){ solve(); } return 0; }