提出 #38211491


ソースコード 拡げる

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, j, n) for (int i = j; i < (int)(n); i++)
 
int main() {
  int N, P, Q, R, S;
  int cnt =0;
  
  cin >> N >> P >> Q >> R >> S;
  
  vector<int> A(N);

  rep(i, 0, N){
    cin >> A.at(i);
  }
  rep(i, 0, P-1){
    cout << A.at(i) << " ";
  }
  rep(i, 0, Q-P+1){
    cout << A.at(i+R-1) << " ";
  }
  rep(i, Q, R-1){
    cout << A.at(i) << " ";
  }
  rep(i, 0, Q-P+1){
    cout << A.at(i+P-1) << " ";
  }
  rep(i, S, N){
    cout << A.at(i) << " ";
  }
}

提出情報

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

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:7: warning: unused variable ‘cnt’ [-Wunused-variable]
    8 |   int cnt =0;
      |       ^~~

ジャッジ結果

セット名 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 4 ms 3456 KiB
example_01.txt AC 2 ms 3440 KiB
example_02.txt AC 2 ms 3408 KiB
example_03.txt AC 2 ms 3424 KiB
hand_00.txt AC 2 ms 3512 KiB
hand_01.txt AC 5 ms 3536 KiB
hand_02.txt AC 2 ms 3520 KiB
hand_03.txt AC 3 ms 3440 KiB
random_00.txt AC 2 ms 3440 KiB
random_01.txt AC 3 ms 3488 KiB
random_02.txt AC 2 ms 3376 KiB
random_03.txt AC 2 ms 3460 KiB
random_04.txt AC 2 ms 3456 KiB
random_05.txt AC 2 ms 3412 KiB