結果
問題 | No.1366 交換門松列・梅 |
ユーザー | どらら |
提出日時 | 2021-01-29 21:26:46 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 832 bytes |
コンパイル時間 | 1,812 ms |
コンパイル使用メモリ | 164,352 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-04-17 10:22:04 |
合計ジャッジ時間 | 2,883 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 3 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 3 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 3 ms
5,376 KB |
testcase_11 | AC | 3 ms
5,376 KB |
testcase_12 | AC | 3 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; bool is_kadomatsu(const vector<ll>& v){ if(v[0] == v[1] || v[0] == v[2] || v[1] == v[2]) return false; if(v[0] < v[1] && v[1] > v[2]) return true; if(v[0] > v[1] && v[1] < v[2]) return true; return false; } int main(){ vector<ll> v(3), w(3); rep(i,3) cin >> v[i]; rep(i,3) cin >> w[i]; rep(i,3){ rep(j,3){ swap(v[i], w[j]); if(is_kadomatsu(v) && is_kadomatsu(w)){ cout << "Yes" << endl; return 0; } swap(v[i], w[j]); } } cout << "No" << endl; return 0; }