結果
| 問題 |
No.2607 Add One Digit
|
| コンテスト | |
| ユーザー |
ococonomy1
|
| 提出日時 | 2024-01-19 21:23:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,647 bytes |
| コンパイル時間 | 1,033 ms |
| コンパイル使用メモリ | 110,052 KB |
| 最終ジャッジ日時 | 2025-02-18 20:34:16 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll,int>;
#define TEST cerr << "TEST" << endl
#define AMARI 998244353
// #define AMARI 1000000007
#define TIME_LIMIT 1980000
#define el '\n'
#define El '\n'
#define MULTI_TEST_CASE false
void solve(void) {
//問題を見たらまず「この問題設定から言えること」をいっぱい言ってみる
//一個解答に繋がりそうな解法が見えても、実装や細かい考察に時間がかかりそうなら別の方針やを考えてみる
//特に添え字周りはそのままやると面倒&言い換えが有効なことが多いので書き始める前にじっくり考える
string s;
cin >> s;
set<string> st;
int n = s.size();
string t = "1" + s;
for(int i = 0; i <= n; i++){
for(char j = '0'; j <= '9'; j++){
t[i] = j;
if(t.front() != '0')st.insert(t);
}
swap(t[i],t[i + 1]);
}
cout << st.size() << el;
return;
}
void calc(void) {
return;
}
signed main(void) {
cin.tie(nullptr);
ios::sync_with_stdio(false);
calc();
int t = 1;
if(MULTI_TEST_CASE) cin >> t;
while(t--) {
solve();
}
return 0;
}
ococonomy1