結果
問題 |
No.2607 Add One Digit
|
ユーザー |
![]() |
提出日時 | 2025-09-04 23:43:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 1,815 ms |
コンパイル使用メモリ | 200,948 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-04 23:43:34 |
合計ジャッジ時間 | 3,129 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; string s; set<string> st; int main() { cin >> s; int l = s.size(); for (int i = 0; i <= l; i++) { for (char d = '0'; d <= '9'; d++) { if (i == 0 && d == '0') continue; string t = ""; for (int j = 0; j < i; j++) t += s[j]; t += d; for (int j = i; j < l; j++) t += s[j]; st.insert(t); } } cout << st.size() << "\n"; return 0; }