提出 #38196505


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ld = long double;
using pll = pair<ll, ll>;
// and so on
int arr[101];
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int N, A, B, C, D;
    cin>>N>>A>>B>>C>>D;
    for(int i=1;i<=N;i++) cin>>arr[i];
    for(int i=A,j=C;i<=B;i++,j++) swap(arr[i],arr[j]);
    for(int i=1;i<=N;i++) cout<<arr[i]<<' ';
}

提出情報

提出日時
問題 A - Range Swap
ユーザ jame0313
言語 C++ (GCC 9.2.1)
得点 100
コード長 439 Byte
結果 AC
実行時間 6 ms
メモリ 3560 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 4
AC × 14
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt, example_03.txt
All example_00.txt, example_01.txt, example_02.txt, example_03.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 6 ms 3492 KiB
example_01.txt AC 2 ms 3436 KiB
example_02.txt AC 2 ms 3440 KiB
example_03.txt AC 2 ms 3488 KiB
hand_00.txt AC 2 ms 3492 KiB
hand_01.txt AC 2 ms 3440 KiB
hand_02.txt AC 2 ms 3436 KiB
hand_03.txt AC 2 ms 3440 KiB
random_00.txt AC 2 ms 3480 KiB
random_01.txt AC 2 ms 3532 KiB
random_02.txt AC 2 ms 3492 KiB
random_03.txt AC 2 ms 3560 KiB
random_04.txt AC 2 ms 3484 KiB
random_05.txt AC 2 ms 3488 KiB