Submission #366345

#TimeUsernameProblemLanguageResultExecution timeMemory
366345arujbansalSifra (COCI21_sifra)C++17
50 / 50
1 ms384 KiB
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <set> #include <array> #include <stack> #include <queue> #include <random> #include <numeric> #include <chrono> #include <utility> #include <iomanip> #include <assert.h> using namespace std; void dbg_out() { cerr << endl; } template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); } #define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__) #define rng_init mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) #define rng_seed(x) mt19937 rng(x) #define all(x) (x).begin(), (x).end() #define sz(x) (int) (x).size() // #define int long long const int MXN = 1e5 + 1, INF = 1e9 + 1; void solve() { string S; cin >> S; int N = sz(S); set<string> st; for (int i = 0, j = 0; i < N; i++) { if (!(S[i] >= '0' && S[i] <= '9')) continue; string num; for (j = i; j < N && (S[j] >= '0') && (S[j] <= '9'); j++) num += S[j]; i = j - 1; if (sz(num) > 0) st.insert(num); } cout << sz(st); } signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int TC = 1; // cin >> TC; while (TC--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...