結果

問題 No.2246 1333-like Number
ユーザー jiangly
提出日時 2023-03-21 23:38:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 193,424 KB
最終ジャッジ日時 2025-02-11 15:57:13
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int N;
    std::cin >> N;
    
    N--;
    int c = N / 36;
    N %= 36;
    for (int a = 1; ; a++) {
        for (int b = a + 1; b <= 9; b++) {
            if (N == 0) {
                std::cout << a << b;
                while (c--) {
                    std::cout << b;
                }
                std::cout << "\n";
                return 0;
            } else {
                N--;
            }
        }
    }
    
    return 0;
}
0