///made by : Mr_Ph :D
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
const double PI=acos(-1.0);
const ll mod=(ll)1e9+7;
//int dx[4] = {0, 0, 1, -1};
//int dy[4] = {1, -1, 0, 0};
///the defines :)
#define endl '\n'
#define vi vector<int>
#define vll vector<ll>
#define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
///the end of the defines ;)
void solve()
{
string s;
cin>>s;
set<string>st;
string temp="";
for(int i=0;i<s.sz;i++)
{
if(s[i]>='0'&&s[i]<='9')
temp+=s[i];
else
{
if(temp!="");
st.insert(temp);
temp="";
}
}
if(temp!="");
st.insert(temp);
temp="";
cout<<st.sz<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//freopen("window.in","r",stdin);
//freopen("output.txt","w",stdout);
int t=1;//int st;
//cin>>t;//cin>>st;
while(t--)
solve();
}
Compilation message
Main.cpp: In function 'void solve()':
Main.cpp:29:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | for(int i=0;i<s.sz;i++)
| ^
Main.cpp:40:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
40 | if(temp!="");
| ^~
Main.cpp:41:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
41 | st.insert(temp);
| ^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |