Submission #375123

#TimeUsernameProblemLanguageResultExecution timeMemory
375123AdiZer0Sifra (COCI21_sifra)C++17
50 / 50
1 ms364 KiB
#include <bits/stdc++.h> #define pb push_back #define whole(x) x.begin(), x.end() #define sz(x) (int)x.size() using namespace std; typedef long long ll; typedef long double ld; const int N = (int)2e6 + 8; const int INF = (int)1e9 + 7; const ll linf = (ll)1e15 + 2; map<string, bool> was; int cnt; string cur; void upd() { if (!cur.empty()) { if (!was[cur]) ++cnt, was[cur] = 1; cur = ""; } } int main() { string s; cin >> s; int n = sz(s); for (int i = 0; i < n; ++i) { if ('a' <= s[i] && s[i] <= 'z') { if (!cur.empty()) upd(); continue; } if (sz(cur) == 3) upd(); cur += s[i]; } upd(); cout << cnt << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...