結果
| 問題 | No.2607 Add One Digit |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2024-02-13 15:51:55 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 401µs | |
| コード長 | 522 bytes |
| 記録 | |
| コンパイル時間 | 1,000 ms |
| コンパイル使用メモリ | 188,164 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-05 17:30:53 |
| 合計ジャッジ時間 | 2,608 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
int main() {
string s;
cin >> s;
int N = s.size();
set<ll> st;
rep(i, N) {
rep(j, 10) {
string c(1, (char)(j + '0'));
string t = s.substr(0, i + 1) + c + s.substr(i + 1, N - i - 1);
ll n = atoll(t.c_str());
st.insert(n);
}
}
for(int i = 1; i < 10; i++ ) {
string c(1, (char)(i + '0'));
string t = c + s;
ll n = atoll(t.c_str());
st.insert(n);
}
cout << st.size() << endl;
}
forest3