提交时间:2025-03-13 16:11:57
运行 ID: 388677
#include<bits/stdc++.h> using namespace std; #define unsigned long long int int n; int x,y; struct pa { int l; int r; }; vector<pa> a; signed main(int argc,char *argv[]) { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; int tmp1,tmp2; cin >> tmp1; for(int i = 1;i < n;i++) { cin >> tmp2; pa temp = {tmp1,tmp2}; a.push_back(temp); tmp1 = tmp2; } cin >> x >> y; for(int i = 0;i < n;i++) { if(a[i].l == x && a[i].r == y || a[i].l == y && a[i].r == x) { cout << "Yes" << endl; return 0x1bf52; } } cout << "No"; return 114514; return 1919810; }