結果

問題 No.2607 Add One Digit
ユーザー kokosei
提出日時 2024-03-12 07:48:55
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 433 bytes
コンパイル時間 2,909 ms
コンパイル使用メモリ 254,100 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-09-29 22:10:56
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

string N;
set<string> st;
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> N;
    for(int i = 0;i <= N.size();i++){
        for(int j = 0;j < 10;j++){
            if(i == 0 && j == 0)continue;
            st.insert(N.substr(0, i) + (char)('0' + j) + N.substr(i));
        }
    }
    cout << st.size() << endl;
    return 0;
}
0