結果
問題 | No.2607 Add One Digit |
ユーザー |
|
提出日時 | 2024-01-20 20:31:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 552 bytes |
コンパイル時間 | 1,885 ms |
コンパイル使用メモリ | 173,844 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-28 05:45:44 |
合計ジャッジ時間 | 2,752 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; vector<ll> tmp; for(int i = 0; i <= s.size(); i++){ for(char c = '0'; c <= '9'; c++){ string t = s; if(i == 0 && c == '0') continue; t.insert(t.begin() + i, c); tmp.emplace_back(stoll(t)); } } sort(tmp.begin(), tmp.end()); tmp.erase(unique(tmp.begin(), tmp.end()), tmp.end()); cout << tmp.size() << '\n'; }