Please sign in first.
Submission #62022366
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
using ll=long long;
using P=pair<int,int>;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353;
int main() {
const int n = 5;
vector<int> a(n);
rep(i,n) cin >> a[i];
vector<int> b = a;
sort(b.begin(),b.end());
rep(i,n-1) {
swap(a[i],a[i+1]);
if (a == b) {
cout << "Yes" << endl;
return 0;
}
swap(a[i],a[i+1]);
}
cout << "No" << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 12435 |
| User | ty70 |
| Language | C++ 20 (gcc 12.2) |
| Score | 150 |
| Code Size | 561 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3688 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 | 3688 KiB |
| 00_sample_01.txt | AC | 1 ms | 3472 KiB |
| 00_sample_02.txt | AC | 1 ms | 3608 KiB |
| 00_sample_03.txt | AC | 1 ms | 3536 KiB |
| 01_handmade_00.txt | AC | 1 ms | 3528 KiB |
| 01_handmade_01.txt | AC | 1 ms | 3532 KiB |
| 01_handmade_02.txt | AC | 1 ms | 3492 KiB |
| 02_Yes_00.txt | AC | 1 ms | 3480 KiB |
| 02_Yes_01.txt | AC | 1 ms | 3404 KiB |
| 03_No_00.txt | AC | 1 ms | 3688 KiB |
| 03_No_01.txt | AC | 1 ms | 3488 KiB |
| 03_No_02.txt | AC | 1 ms | 3568 KiB |
| 03_No_03.txt | AC | 1 ms | 3480 KiB |
| 03_No_04.txt | AC | 1 ms | 3480 KiB |
| 03_No_05.txt | AC | 1 ms | 3468 KiB |