728x90

자라는 개발자/문제풀이 118

백준 c++ 7785 회사에 있는 사람

7785 회사에 있는 사람 문제 풀이 #include #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main(void) { fast_io(); multiset set; //set은 자동정렬된다. 그냥set 과 다른 점은 중복허용 int n; cin >> n; while (n--) { string str1, str2; cin >> str1 >> str2; if (str2 == "enter") set.insert(str1); else set.erase(str1); } for (auto it = set.rbegin(); it..

백준 c++ 1919 애너그램 만들기

1919번 애너그램 만들기 문제 풀이 #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main(void) { fast_io(); string a, b; cin >> a >> b; int alpha[26], alpha2[26], cnt = 0; fill_n(alpha, 26, 0); fill_n(alpha2, 26, 0); for (int i = 0; i < a.length(); i++) { alpha[a[i] - 97]++; } for (int i = 0; i < b.length(); i++) { alpha2[b[i] -..

728x90