Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
363585 向楚αβ∑+-*/ 牢尸 *小美的排列询问 C++ 解答错误 60 0 MS 1044 KB 371 2025-02-04 09:47:36

Tests(3/5):


#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 = 0, sy = 0; 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; } //1 3 4 5 2 7 6 9 8 //


测评信息: