Submission #62026656


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef ABHISHEK_SRIVASTAVA
freopen("Input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
int arr[5];
for (int i = 0; i < 5; i++)
cin >> arr[i];
string ans = "No";
for (int i = 1; i < 5; i++) {
swap(arr[i], arr[i - 1]);
if (is_sorted(arr, arr + 5)) {
ans = "Yes";
break;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;

int main() {
    #ifdef ABHISHEK_SRIVASTAVA
        freopen("Input.txt", "r", stdin);
        freopen("Output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int arr[5];
    for (int i = 0; i < 5; i++)
        cin >> arr[i];
    string ans = "No";
    for (int i = 1; i < 5; i++) {
        swap(arr[i], arr[i - 1]);
        if (is_sorted(arr, arr + 5)) {
            ans = "Yes";
            break;
        }
        swap(arr[i], arr[i - 1]);
    }
    cout << ans;

    return 0;
}

Submission Info

Submission Time
Task A - 12435
User Abhi_Srivastava
Language C++ 20 (Clang 16.0.6)
Score 150
Code Size 597 Byte
Status AC
Exec Time 1 ms
Memory 3584 KB

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 1 ms 3420 KB
00_sample_01.txt AC 1 ms 3452 KB
00_sample_02.txt AC 1 ms 3472 KB
00_sample_03.txt AC 1 ms 3516 KB
01_handmade_00.txt AC 1 ms 3432 KB
01_handmade_01.txt AC 1 ms 3408 KB
01_handmade_02.txt AC 1 ms 3388 KB
02_Yes_00.txt AC 1 ms 3448 KB
02_Yes_01.txt AC 1 ms 3456 KB
03_No_00.txt AC 1 ms 3440 KB
03_No_01.txt AC 1 ms 3584 KB
03_No_02.txt AC 1 ms 3424 KB
03_No_03.txt AC 1 ms 3524 KB
03_No_04.txt AC 1 ms 3408 KB
03_No_05.txt AC 1 ms 3328 KB


2025-03-01 (Sat)
08:05:45 +00:00