Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
230140 | 2224梁翁思译 | *小美的排列询问 | C++ | 通过 | 100 | 4 MS | 3912 KB | 637 | 2024-01-07 16:25:21 |
#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; }