백준 c++ 1120 문자열 1120 문자열 문제풀이 #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { fast_io(); int res = 50; string a, b; cin >> a >> b; for (int i = 0; i 자라는 개발자/문제풀이 2022.01.24
백준 C++ 1439 뒤집기 1439 뒤집기 문제풀이 #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 s; cin >> s; int o = 0, z = 0; for (int i = 0; i < s.size(); i++) { if (s[i] != s[i + 1]) { if (s[i] == '0') z++; else o++; } } cout 자라는 개발자/문제풀이 2022.01.23
백준 c++ 21156 A Rank Problem 21156 A Rank Problem 문제풀이 #include #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { fast_io(); list l; std::list::iterator it; int n, m; cin >> n >> m; for (int i = 1; i > a >> b; int winner = stoi(a.substr(1)); int loser = stoi(b.substr(1)); int i = 0, ck = 0; for (auto it = l.begin(); it != l.end(); it++.. 자라는 개발자/문제풀이 2022.01.21
백준 c++ 10104 Party Invitation 10104 Party Invitation 문제 풀이 #include #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { fast_io(); list l; int k, m; cin >> k >> m; for (int i = 0; i > r; it = l.begin(); while (it != l.end()) { if (i % r == 0) { it =.. 자라는 개발자/문제풀이 2022.01.20
백준 c++ 1235 학생 번호 1235 학생 번호 문제풀이 #include #include #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { vector v; fast_io(); int n, res = 1; cin >> n; while (n--) { string str; cin >> str; reverse(str.begin(), str.end()); v.push_back(str); } while (true) { set s; for (int i = 0; i < v.size(); i++) { s.insert(v[i].substr(0, res.. 자라는 개발자/문제풀이 2022.01.19
백준 c++ 1205번 등수 구하기 1205번 등수 구하기 문제풀이 #include #include #include using namespace std; void fast_io(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { vector v; fast_io(); int n, score, p, res = 0; // 랭킹목록, 태수점수, 랭킹개수 cin >> n >> score >> p; if (n == 0) { cout > a; v.push_back(a); } sort(v.rbegin(), v.rend()); if (v.back() >= score && v.size() == p) cout 자라는 개발자/문제풀이 2022.01.19
백준 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.. 자라는 개발자/문제풀이 2022.01.15
백준 c++ 5397 키로거 5397 키로거 문제 풀이 #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(); int t; cin >> t; while (t--) { string str; list l; cin >> str; list::iterator iter = l.end(); for (int i = 0; i < str.length(); i++) { if (isdigit(str[i]) || isalpha(str[i])) l.insert(iter, str[i]); else if (str[i] == ''.. 자라는 개발자/문제풀이 2022.01.14
백준 c++ 1380 귀걸이 1380 귀걸이 문제 풀이 #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(); int num = 1; while (num) { vector v; int arr[222] = { 0, }; int n; cin >> n; if (n == 0) break; cin.ignore(); for (int i = 0; i < n; i++) { string str; getline(cin, str); v.push_back(str); } for (int i = 0; i < n * 2 - 1; i++) { int a; c.. 자라는 개발자/문제풀이 2022.01.14
백준 c++ 1406번 에디터 1406번 에디터 문제 풀이 #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 str; list l; cin >> str; for (int i = 0; i > m; while (m--) { char order; cin >> order; //abcd if (order == 'L') { if (iter.. 자라는 개발자/문제풀이 2022.01.14