# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
221977 | Haunted_Cpp | Imena (COCI16_imena) | C++17 | 5 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
author: Haunted_Cpp
*/
#include <iostream>
#include <algorithm>
#include <vector>
#pragma GCC optimize ("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
int main () {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
string w;
cin >> n >> ws;
getline (cin, w);
vector<string> frases;
string cur;
string fim = ".?!";
for (char c : w) {
if (fim.find(c) != string::npos) {
frases.emplace_back(cur);
cur.clear();
} else {
cur += c;
}
}
for (string to : frases) {
int res = 0;
for (int i = 0; i < (int) to.size(); ) {
string palavra;
while (i < (int) to.size() && to[i] != ' ') {
palavra += to[i];
++i;
}
++i;
if (palavra.empty()) continue;
if (!isupper(palavra[0])) continue;
for (int j = 1; j < (int) palavra.size(); j++) {
if (isupper(palavra[j]) || isdigit(palavra[j])) goto fim;
}
++res;
fim:;
}
cout << res << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |