結果
問題 | No.2607 Add One Digit |
ユーザー |
![]() |
提出日時 | 2024-01-19 22:46:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 2,133 ms |
コンパイル使用メモリ | 199,324 KB |
最終ジャッジ日時 | 2025-02-18 21:26:42 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); string N; cin>>N; int n=N.size(); set<string> s; for(int i=1;i<10;i++){ char a=char('0'+i); s.insert(a+N); } rep(i,n){ for(int j=0;j<10;j++){ char a=char('0'+j); s.insert(N.substr(0,i+1)+a+N.substr(i+1)); } } cout<<s.size()<<endl; return 0; }