結果

問題 No.1837 Same but Different
ユーザー ktr216ktr216
提出日時 2022-02-11 23:36:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,456 bytes
コンパイル時間 1,691 ms
コンパイル使用メモリ 168,800 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 06:36:26
合計ジャッジ時間 4,975 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 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 <bits/stdc++.h>
using namespace std;

using ll = long long;
using VI = vector<int>;
using P = pair<int, int>;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (ll i = a; i < (ll)(b); i++)
#define ALL(a) (a).begin(),(a).end()

constexpr int INF = 1001001001;
constexpr ll LINF = 1001001001001001001ll;
constexpr int DX[] = {1, 0, -1, 0};
constexpr int DY[] = {0, 1, 0, -1};

template< typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true); }
template< typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true); }

const ll MOD = 998244353;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    int N;
    cin >> N;
    VI A(0), B(0);
    bool f = false;
    REP(i, N) {
        if (3 * i == 6996) {
            f = true;
        } else {
            A.push_back(3 * i);
        }
    }
    if (f) {
        A.push_back(9996);
    } else {
        A.back() += N / 3 * 3;
    }
    REP(i, N) B.push_back(3 * i + 1);
    if (N % 3 == 1) A.back()++;
    if (N % 3 == 2) {
        A.back() += 3;
        B.back()--;
    }
    REP(i, N) {
        cout << A[i];
        if (i < N - 1) cout << " ";
    }
    cout << endl;
    REP(i, N) {
        cout << B[i];
        if (i < N - 1) cout << " ";
    }
    cout << endl;
}
0