#include<bits/stdc++.h>
using namespace std;
#pragma GCC target ("avx2")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("O3")
#define F first
#define S second
#define sz size()
#define pb push_back
#define int long long
#define all(x) (x).begin(),(x).end()
#define NFS ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) ;
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
template <class T> inline T pw(T a, int n, T res = 1){while (n) {if (n & 1) res *= a;a *= a;n >>= 1;}return res;}
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << '{'; for (auto v : vec) os << v << ' '; os << '}'; return os; }
const int E = 1e6+777;
const int inf = 4e9+777;
const int N = 5e4+10;
string s, t;
set<string> ans;
signed main(){auto solve=[&](){
cin >> s;
s += '$';
for(auto i : s){
if(isdigit(i)){
t += i;
}else if(!t.empty()){
ans.insert(t);
t.clear();
}
}
cout << ans.sz;
};NFS;solve();}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |