結果
| 問題 |
No.2836 Comment Out
|
| コンテスト | |
| ユーザー |
Pres1dent
|
| 提出日時 | 2024-08-09 22:07:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 687 bytes |
| コンパイル時間 | 2,053 ms |
| コンパイル使用メモリ | 199,580 KB |
| 最終ジャッジ日時 | 2025-02-23 21:38:18 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 29 WA * 23 |
ソースコード
#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
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(0, 0);
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;
}
Pres1dent