Submission #62051034
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define ss second#define ff first#define pb push_back#define mod 1000000007#define endl "\n"using namespace std;ll n,m,a[1005];char c;int main(){ios::sync_with_stdio(false);cout.tie(0);cin.tie(0);for (int i=1; i<=5; i++){cin>>a[i];}for (int i=1; i<=4; i++){if (a[i]==i+1&&a[i+1]==i) {a[i]=i; a[i+1]=i+1; m++; break;}}for (int i=1; i<=5; i++)
#include<bits/stdc++.h> #define ll long long #define ss second #define ff first #define pb push_back #define mod 1000000007 #define endl "\n" using namespace std; ll n,m,a[1005]; char c; int main(){ ios::sync_with_stdio(false); cout.tie(0); cin.tie(0); for (int i=1; i<=5; i++) {cin>>a[i]; } for (int i=1; i<=4; i++) {if (a[i]==i+1&&a[i+1]==i) {a[i]=i; a[i+1]=i+1; m++; break;} } for (int i=1; i<=5; i++) {if (a[i]!=i) n++; } if (n==0&&m==1) cout<<"Yes"; else cout<<"No"; }
Submission Info
Submission Time | |
---|---|
Task | A - 12435 |
User | Tegshzaya |
Language | C++ 20 (gcc 12.2) |
Score | 150 |
Code Size | 556 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3612 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 | 3400 KB |
00_sample_01.txt | AC | 1 ms | 3532 KB |
00_sample_02.txt | AC | 1 ms | 3424 KB |
00_sample_03.txt | AC | 1 ms | 3456 KB |
01_handmade_00.txt | AC | 1 ms | 3472 KB |
01_handmade_01.txt | AC | 1 ms | 3412 KB |
01_handmade_02.txt | AC | 1 ms | 3532 KB |
02_Yes_00.txt | AC | 1 ms | 3396 KB |
02_Yes_01.txt | AC | 1 ms | 3612 KB |
03_No_00.txt | AC | 1 ms | 3404 KB |
03_No_01.txt | AC | 1 ms | 3608 KB |
03_No_02.txt | AC | 1 ms | 3484 KB |
03_No_03.txt | AC | 1 ms | 3424 KB |
03_No_04.txt | AC | 1 ms | 3472 KB |
03_No_05.txt | AC | 1 ms | 3432 KB |