# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
221977 | Haunted_Cpp | Imena (COCI16_imena) | C++17 | 5 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
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... |