Submission #74615363


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main() {
  bool ans = false;
  vector<int> A(5);
  vector<int> B(5);
  for(int i = 0; i < 5; i++){
    cin >> A.at(i);
    B.at(i) = A.at(i);
  }
  sort(B.begin(), B.end());
  for(int i = 0; i < 4; i++){
    swap(A.at(i), A.at(i+1));
    if(A == B){
      ans = true;
      break;
    }
    swap(A.at(i),A.at(i+1));
  }
  if(ans){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Submission Info

Submission Time
Task A - 12435
User HakulowWayoi
Language C++23 (GCC 15.2.0)
Score 150
Code Size 478 Byte
Status AC
Exec Time 2 ms
Memory 3684 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 4
AC × 15
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 2 ms 3556 KiB
00_sample_01.txt AC 1 ms 3684 KiB
00_sample_02.txt AC 1 ms 3596 KiB
00_sample_03.txt AC 1 ms 3520 KiB
01_handmade_00.txt AC 1 ms 3684 KiB
01_handmade_01.txt AC 1 ms 3576 KiB
01_handmade_02.txt AC 1 ms 3640 KiB
02_Yes_00.txt AC 1 ms 3528 KiB
02_Yes_01.txt AC 1 ms 3520 KiB
03_No_00.txt AC 1 ms 3440 KiB
03_No_01.txt AC 1 ms 3596 KiB
03_No_02.txt AC 1 ms 3596 KiB
03_No_03.txt AC 1 ms 3600 KiB
03_No_04.txt AC 1 ms 3596 KiB
03_No_05.txt AC 1 ms 3520 KiB