Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
388677 | 太高24徐瑞泽 | *小美的排列询问 | C++ | Accepted | 100 | 4 MS | 3916 KB | 637 | 2025-03-13 16:11:57 |
#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; }