Submission #62022773
Source Code Expand
#include <iostream>
using namespace std;
int main(){
int a[5];
cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
bool e[5];
for(int i= 0;i<5;i++) e[i] = (a[i] == i+1);
int z = 0;
int k = 0;
for(int i = 0;i<5;i++){
if(!e[i]){
z++;
if(i && !e[i-1]) k =1;
}
}
if(z==2 && k == 1) cout<<"Yes\n";
else cout<<"No\n";
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 12435 |
| User | andrii |
| Language | C++ 20 (gcc 12.2) |
| Score | 150 |
| Code Size | 410 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3640 KiB |
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 | 3492 KiB |
| 00_sample_01.txt | AC | 1 ms | 3432 KiB |
| 00_sample_02.txt | AC | 1 ms | 3456 KiB |
| 00_sample_03.txt | AC | 1 ms | 3640 KiB |
| 01_handmade_00.txt | AC | 1 ms | 3468 KiB |
| 01_handmade_01.txt | AC | 1 ms | 3400 KiB |
| 01_handmade_02.txt | AC | 1 ms | 3488 KiB |
| 02_Yes_00.txt | AC | 1 ms | 3488 KiB |
| 02_Yes_01.txt | AC | 1 ms | 3444 KiB |
| 03_No_00.txt | AC | 1 ms | 3436 KiB |
| 03_No_01.txt | AC | 1 ms | 3432 KiB |
| 03_No_02.txt | AC | 1 ms | 3436 KiB |
| 03_No_03.txt | AC | 1 ms | 3508 KiB |
| 03_No_04.txt | AC | 1 ms | 3500 KiB |
| 03_No_05.txt | AC | 1 ms | 3552 KiB |