提交时间:2024-01-07 16:10:21

运行 ID: 230113

#include<bits/stdc++.h> using namespace std; #define unsigned long long int int n; int a[2000005] = {0}; int x,y; signed main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for(int i = 0;i < n;i++) { int tmp; cin >> tmp; a[tmp] = i; } cin >> x >> y; if(a[x] - a[y] == 1) { cout << "Yes"; return 0; } cout << "No"; return 114514; return 1919810; }