結果
| 問題 |
No.2607 Add One Digit
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-19 21:23:22 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 532 bytes |
| コンパイル時間 | 2,819 ms |
| コンパイル使用メモリ | 255,032 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-28 03:52:28 |
| 合計ジャッジ時間 | 3,483 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
// #include <x86intrin.h>
using namespace std;
#if __cplusplus >= 202002L
using namespace numbers;
#endif
int main(){
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(ios::badbit | ios::failbit);
string s;
cin >> s;
set<long long> res;
for(auto c = '1'; c <= '9'; ++ c){
res.insert(stoll(c + s));
}
for(auto i = 1; i <= (int)s.size(); ++ i){
for(auto c = '0'; c <= '9'; ++ c){
res.insert(stoll(s.substr(0, i) + c + s.substr(i)));
}
}
cout << (int)res.size() << "\n";
return 0;
}
/*
*/