結果

問題 No.2607 Add One Digit
ユーザー soldray
提出日時 2024-01-22 18:42:55
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 618 bytes
コンパイル時間 1,723 ms
コンパイル使用メモリ 129,728 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-28 06:27:51
合計ジャッジ時間 2,556 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

using i64 = long long;

#define yn(pope) (pope ? "Yes" : "No")

#define rep(i, n, m) for (int i = (n); i < (m); i++)
#define rrep(i, n, m) for (int i = (n); i > m; i--)

#define IINF (1 << 30)
#define INF (1ll << 60)

#define all(v) v.begin(), v.end()

int main() {
  string s; cin >> s;
  set<string> S;

  rep(i, 0, s.length() + 1) {
    rep(j, 0, 10) {
      string t = s;
      t.insert(t.begin() + i, (char)('0' + j));

      S.insert(t);
    }
  }

  cout << S.size() - 1 << endl;

  return 0;
}
0