UVa10815

題目:
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1756

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 0x3f3f3f3f
#define all(x) (x).begin(), (x).end()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

set<string> s;

int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
char c;
string word = "";
while(cin.get(c)){
if(isalpha(c)) word += tolower(c);
else{
if(word != "") s.insert(word);
word = "";
}
}
for(auto& str : s) cout << str << '\n';
return 0;
}