提出 #62021069


ソースコード 拡げる

Copy
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> a(5);
for (int i = 0; i < 5; i++) cin >> a[i];
bool flag = 0;
for (int i = 0; i < 4; i++) {
vector<int> b = a;
swap(b[i], b[i + 1]);
vector<int> c = b;
sort(c.begin(), c.end());
if (b == c) flag = 1;
}
cout << (flag ? "Yes" : "No") << '\n';
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a(5);
  for (int i = 0; i < 5; i++) cin >> a[i];
  bool flag = 0;
  for (int i = 0; i < 4; i++) {
    vector<int> b = a;
    swap(b[i], b[i + 1]);
    vector<int> c = b;
    sort(c.begin(), c.end());
    if (b == c) flag = 1;
  }
  cout << (flag ? "Yes" : "No") << '\n';
  return 0;
}

提出情報

提出日時
問題 A - 12435
ユーザ transparentheart
言語 C++ 20 (gcc 12.2)
得点 150
コード長 372 Byte
結果 AC
実行時間 1 ms
メモリ 3560 KB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 150 / 150
結果
AC × 4
AC × 15
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3528 KB
00_sample_01.txt AC 1 ms 3492 KB
00_sample_02.txt AC 1 ms 3556 KB
00_sample_03.txt AC 1 ms 3492 KB
01_handmade_00.txt AC 1 ms 3540 KB
01_handmade_01.txt AC 1 ms 3492 KB
01_handmade_02.txt AC 1 ms 3484 KB
02_Yes_00.txt AC 1 ms 3492 KB
02_Yes_01.txt AC 1 ms 3452 KB
03_No_00.txt AC 1 ms 3524 KB
03_No_01.txt AC 1 ms 3472 KB
03_No_02.txt AC 1 ms 3488 KB
03_No_03.txt AC 1 ms 3560 KB
03_No_04.txt AC 1 ms 3444 KB
03_No_05.txt AC 1 ms 3440 KB


2025-04-01 (火)
18:08:15 +00:00