提交时间:2024-01-07 16:21:44
运行 ID: 230133
#include<bits/stdc++.h> using namespace std; #define unsigned long long int int n; int a[2000005] = {0}; int x,y; signed main(int argc,char *argv[]) { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for(int i = 1;i <= n;i++) { int tmp; cin >> tmp; a[tmp] = i; } cin >> x >> y; if(abs(a[x] - a[y]) == 1) { cout << "Yes"; return 0x1bf52; } cout << "No"; return 114514; return 1919810; }