Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
283859 | 向楚αβ∑+-*/ 牢尸 | *小美的排列询问 | C++ | 解答错误 | 60 | 4 MS | 1056 KB | 338 | 2024-10-04 14:39:25 |
#include <bits/stdc++.h> using namespace std; int n, x, y; int a[200010]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } cin >> x >> y; int sx, sy; for (int i = 1; i <= n; i++) { if (a[i] == x) sx = i; if (a[i] == y) sy = i; } cout << (abs(sx - sy) == 1 ? "Yes" : "No"); return 0; }