Submission #62026354
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;#define int long long#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);#define nl "\n";#define inf LLONG_MAX#define pb push_back#define pi pair<int, int>#define mp make_pair#define ff first#define ss second#define show(x) cerr << #x << " is " << x << nl;#define showw(x, y) cerr << #x << " is " << x << " " << #y << " is " << y << nl;#define showall(x) cerr << #x << " is "; for (auto i : x) {cerr << i << " ";} cerr << nl;bool check(int x[]){bool pos = true;for (int i=0; i<5; i++){if(x[i]!=(i+1)) pos = false;}return pos;
#include <bits/stdc++.h> using namespace std; #define int long long #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define nl "\n"; #define inf LLONG_MAX #define pb push_back #define pi pair<int, int> #define mp make_pair #define ff first #define ss second #define show(x) cerr << #x << " is " << x << nl; #define showw(x, y) cerr << #x << " is " << x << " " << #y << " is " << y << nl; #define showall(x) cerr << #x << " is "; for (auto i : x) {cerr << i << " ";} cerr << nl; bool check(int x[]){ bool pos = true; for (int i=0; i<5; i++){ if(x[i]!=(i+1)) pos = false; } return pos; } signed main(){ fastio int a[5]; for (int i=0; i<5; i++) cin >> a[i]; bool can = false; for (int i=0; i<4; i++){ int temp[5]; for (int j=0; j<5; j++){ if(j==i) temp[j] = a[i+1]; else if(j==i+1) temp[j] = a[i]; else temp[j] = a[j]; } if(check(temp)) can = true; } if(can) { cout << "Yes" << nl; } else cout << "No" << nl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 12435 |
User | penguin0 |
Language | C++ 17 (gcc 12.2) |
Score | 150 |
Code Size | 1027 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3520 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 150 / 150 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 02_Yes_00.txt, 02_Yes_01.txt, 03_No_00.txt, 03_No_01.txt, 03_No_02.txt, 03_No_03.txt, 03_No_04.txt, 03_No_05.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3452 KB |
00_sample_01.txt | AC | 1 ms | 3464 KB |
00_sample_02.txt | AC | 1 ms | 3468 KB |
00_sample_03.txt | AC | 1 ms | 3472 KB |
01_handmade_00.txt | AC | 1 ms | 3460 KB |
01_handmade_01.txt | AC | 1 ms | 3324 KB |
01_handmade_02.txt | AC | 1 ms | 3448 KB |
02_Yes_00.txt | AC | 1 ms | 3460 KB |
02_Yes_01.txt | AC | 1 ms | 3460 KB |
03_No_00.txt | AC | 1 ms | 3520 KB |
03_No_01.txt | AC | 1 ms | 3460 KB |
03_No_02.txt | AC | 1 ms | 3412 KB |
03_No_03.txt | AC | 1 ms | 3392 KB |
03_No_04.txt | AC | 1 ms | 3468 KB |
03_No_05.txt | AC | 1 ms | 3388 KB |