# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136217 | monaxia | Sifra (COCI21_sifra) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fr first
#define sc second
#define all(v) v.begin(), v.end()
#define mod (long long)(1e9 + 7)
#define eps (long long)(1e-9)
#define vektor vector
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ull Mod = 1e9 + 7;
const ll LIMIT = 2e5;
void solve(){
string a;
cin >> a;
int cur = 0, ans = 0, huh = 0;
vector <int> cnt(1e3, 0);
for(auto& x : a){
if('0' <= x && x <= '9'){
cur = cur * 10 + x - '0';
huh = 1;
continue;
}
if(huh) cnt[cur] ++;
huh = cur = 0;
}
if(huh) cnt[cur] ++;
for(int i = 0; i <= 999; i ++) if(cnt[i]) ans ++;
cout << ans;
}
signed main()
{
cin.tie(0)->sync_with_stdio(0);
// if(fopen("nameholder.inp", "r")){
// freopen("nameholder.inp", "r", stdin);
// freopen("nameholder.out", "w", stdout);
// }
// cout << 1; return 0;
ll n = 1;
// cin >> n;
while(n) {
solve();
n --;
cout << "\n";
}
// cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
return 0;
}
// ++++
// ++++-::......:--:::-=+++
// ++++=:............---.....--:..:=++++++
// +++++++::......................::=+++++
// @@ ++++++++++:+++++++++
// @% @*
// %%@@ *****#*@@
// %%%%% @##**##***%
// @@@@@@+-*#*@ #####%+*##*@
// %#+@%%@@@ ##-%:::-#*###@@
// =====:*::: ###-:==::=#*%*
// -====:::::+@@%@@%@#*--=*#%%#@%@ @%@
// @=====%=-@%=:::.:+-::::+::::::::::::%-----%% @@@@@
// @@%#*@++%===+::-================@%@@@@+++++++@@@%%%@#%###%
// @#***#@@ @##=%@===+--:+==+===+%*##@%%%@@@@@@@@@@:= @%@%%%@#%%
// -@ @*#@ #####%:::-====+:::==---**%#@ *%%%%@@@@@@-:
// -=-*% # #***--%%::::::::+=-+#-----=**@*# #+**#@#
// ----=----#+****=----=*#@=::::::=#-----------***%*%
// ------------%*****##=@==::::::+%-----------***%**
// +-----------------*@++%::::::::-----------****@*#
// =------------% @%=+%#+:::::::* #-----*--**** **
// ----%--% *==+++++=+=##*:% ---=--**** **
// %@@@@@@@@@==@+%%%%@ ----**** *#
// @=*+%@@@%@@=++=:%:::% #***@@#
// #+++++++++#==++-:::::: @**** *#
// =+++++++++++==+++::::::: ####@ #%
// +++++++++++=@ @++++::::::@ @#
// @+++++++++=@ =*++=:::::@
// ++++++++@ @++++:::::
// ++++++= =++++:::
// =+++++@ =+++::::
// ++++++-@ =+++:+::
// @::+::::@ =++::-:::
// +::=::::: @+*+:-+++-:
// @::+-:::::# +++::::::@
// ::%=:::::::%@ @%++::::***
// @:+@*:::::::****@ +@+++:-=*:*@
// *:@@%::::::::=**** @%@+++:::#**@
// *%@@@-:::::::%=+==*@ +@%+++:***+*
// #%@@%%::::::::#+=-=# =+@+++++:::*+
// @####+::::::::%+=@#%#=@ @**@@%=++::::@
// @ +:::::::::***#*@ @@###+=+=%@ +**#+=+*+:::-
// =-:::::::%%%%@@ @#=*########%#+*%%+--@*+::%
// +---%@ @@ =-:-**:#
// %%%%% @+--*@
// @%%%%@ @%%%%%
// @%%@@
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |