結果

問題 No.1837 Same but Different
ユーザー SSRSSSRS
提出日時 2022-02-11 21:50:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 2,039 ms
コンパイル使用メモリ 200,860 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-10 02:00:25
合計ジャッジ時間 4,813 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A, B;
  for (int i = 0; i < (N * 2 + 1) / 3; i++){
    A.push_back(i * 3);
    B.push_back(i * 3 + 1);
  }
  for (int i = (N * 2 + 1) / 3; i < N; i++){
    A.push_back(i * 3 + 3);
    B.push_back(i * 3 + 1);
  }
  if (N % 3 == 1){
    A[N - 1]++;
  }
  if (N % 3 == 2){
    A[N - 1] += 3;
    B[N - 1]++;
  }
  for (int i = 0; i < N; i++){
    cout << A[i];
    if (i < N - 1){
      cout << ' ';
    }
  }
  cout << endl;
  for (int i = 0; i < N; i++){
    cout << B[i];
    if (i < N - 1){
      cout << ' ';
    }
  }
  cout << endl;
}
0