結果
| 問題 | No.2607 Add One Digit |
| コンテスト | |
| ユーザー |
nono00
|
| 提出日時 | 2024-01-19 21:22:13 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 356µs | |
| コード長 | 573 bytes |
| 記録 | |
| コンパイル時間 | 2,091 ms |
| コンパイル使用メモリ | 338,892 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-05 11:53:20 |
| 合計ジャッジ時間 | 3,473 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
void solve() {
std::string s;
std::cin >> s;
std::set<std::string> st;
int n = s.size();
for (int i = 0; i <= n; i++) {
for (int v = 0; v < 10; v++) {
std::string t = s;
t.insert(t.begin() + i, v + '0');
if (t.front() != '0') {
st.insert(t);
}
}
}
std::cout << st.size() << std::endl;
}
int main() {
std::cin.tie(0)->sync_with_stdio(0);
std::cout << std::fixed << std::setprecision(16);
int t = 1;
while (t--) solve();
}
nono00