結果

問題 No.1837 Same but Different
ユーザー 👑 NachiaNachia
提出日時 2022-02-11 22:37:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,242 bytes
コンパイル時間 1,949 ms
コンパイル使用メモリ 112,696 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 04:30:56
合計ジャッジ時間 4,772 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
#include <atcoder/convolution>
using namespace std;


using i64 = long long;
using u64 = unsigned long long;
using i32 = int;
using u32 = unsigned int;
#define rep(i,n) for(int i=0; i<(int)(n); i++)



int main() {
    int N; cin >> N;
    int l = 333, r = 9990;
    vector<int> A; // A[i] mod 3 = 0
    vector<int> B; // B[i] mod 3 = 1
    while(3 <= N){
        A.push_back(l); B.push_back(l+1); l += 3;
        A.push_back(l); B.push_back(l+1); l += 3;
        A.push_back(r); B.push_back(r-2); r -= 3;
        N -= 3;
    }

    if(N == 1){
        B.back()--; r -= 3;
        A.push_back(l); B.push_back(l+1); l += 6;
        N = 0;
    }
    if(N == 2){
        B.back()-=3; r -= 3;
        A.push_back(9999); B.push_back(3);
        A.push_back(1); B.push_back(10000);
    }

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    rep(i,A.size()){ if(i) cout << ' '; cout << A[i]; } cout << '\n';
    rep(i,B.size()){ if(i) cout << ' '; cout << B[i]; } cout << '\n';
    return 0;
}




struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0