結果
問題 | No.2607 Add One Digit |
ユーザー |
|
提出日時 | 2024-01-19 21:22:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 2,138 ms |
コンパイル使用メモリ | 198,860 KB |
最終ジャッジ日時 | 2025-02-18 20:32:36 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include<bits/stdc++.h> using namespace std; string S; int main(){ cin>>S; int n=S.size(); set<string>st; for(int i=0;i<=n;++i){ for(char d='0';d<='9';++d){ string t; for(int j=0;j<i;++j){ t+=S[j]; } t+=d; for(int j=i;j<n;++j){ t+=S[j]; } if(t[0]!='0'){ st.insert(t); } } } cout<<st.size()<<endl; }