結果
問題 |
No.2836 Comment Out
|
ユーザー |
![]() |
提出日時 | 2024-08-09 22:12:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 769 bytes |
コンパイル時間 | 2,263 ms |
コンパイル使用メモリ | 199,364 KB |
最終ジャッジ日時 | 2025-02-23 21:40:04 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 27 WA * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; // 0 0 0 // 1 0 0 // 2 1 0 // 2 0 -1 // 3 1 0 // 0 0 0 // 1 1 0 // 1 0 -1 // 2 1 0 // 1 0 // 0 0 // 0 1 // 2 1 // 1 2 // // x x 0 0 0 0 0 // x x 0 1 1 0 0 // x x -1 0 1 0 0 // x x 0 1 2 0 // 3 0 0 3 possible? // 1 0 0 0 // 2 1 0 0 // 2 0 -1 0 // 3 1 0 0 // 3 1 0 1 // 3 0 -1 1 // 3 1 0 2 int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; bool yes = false; set<pair<int, int>> st; st.emplace(1, 0); st.emplace(0, 1); st.emplace(1, 2); st.emplace(2, 1); for (int i = 0; i < n - 1; i++) { pair<int, int> p = { a[i], a[i + 1] }; if (st.count(p)) yes = true; } if (yes) cout << "Yes" << endl; else cout << "No" << endl; }