string
str1.compare(str2)
str1.find(str2)
str1.rfind(str2)
str1.find(str2, 4)
int idx = 0;
while ((idx = str1.find(str2, idx)) != -1) {
printf("%d\n", idx);
idx += 1;
}
str1.replace(시작 위치, 길이, str2)
int idx = 0;
while ((idx = str1.find(str2, idx)) != -1) {
str1.replace(idx, str2.length(), str3);
idx += str3.length();
}
str.substr(시작위치)
str.substr(시작위치, 길이)
vector
vector<int> v(size, x)
vector<vector<int>> board(rowSize, vector<int>(colSize, x));
set
set.find(x)
set<int>::iterator iter;
for (iter = sett.begin(); iter != sett.end(); ++iter)
printf("%d\n", *iter);
algorithm
lower_bound(v.begin(), v.end(), x)
upper_bound(v.begin(), v.end(), x)
sort(arr, arr+n, greater<>())
struct Comp {
bool operator()(pair<int, int> a, pair<int, int> b) {
if (a.second == b.second)
return a.first < b.first;
return a.second < b.second;
}
};
sort(arr, arr + n, Comp())
priority_queue<pair<int, int>, vector<pair<int, int>>, Comp> pq;