結果

問題 No.1837 Same but Different
ユーザー 👑 NachiaNachia
提出日時 2022-02-11 23:10:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,231 bytes
コンパイル時間 2,645 ms
コンパイル使用メモリ 112,556 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-10 05:41:38
合計ジャッジ時間 5,097 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,384 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 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 = 111, r = 9960;
    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() -= 12;
        A.push_back(1); B.push_back(7);
        A.push_back(4); B.push_back(10);
    }

    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