結果

問題 No.2246 1333-like Number
ユーザー ManjushriMitraManjushriMitra
提出日時 2024-08-10 19:06:05
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 769 bytes
コンパイル時間 2,843 ms
コンパイル使用メモリ 246,876 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-08-10 19:06:12
合計ジャッジ時間 6,324 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

int main(){
    int N;
    cin >> N;

    vector<pair<int,int>> p;
    for(int a = 1; a <= 9; ++a){
        for(int b = a+1; b <= 9; ++b){
            p.push_back({a, b});
        }
    }

    if(N % 36 == 0){
        int cnt = N/36;
        cout << p.back().first << p.back().second;
        rep(i, 0, cnt-1) cout << p.back().second;
        cout << endl;
    }else{
        int i = N % 36 - 1, cnt = N/36;
        cout << p[i].first << p[i].second;
        rep(i, 0, cnt) cout << p[i].second;
        cout << endl;
    }
    return 0;
}
0