그럴듯한 개발 블로그
백준 1620 (c++) 나는야 포켓몬 마스터 이다솜
<algorithm>/백준 2023. 4. 6. 20:15

https://www.acmicpc.net/problem/1620 1620번: 나는야 포켓몬 마스터 이다솜 첫째 줄에는 도감에 수록되어 있는 포켓몬의 개수 N이랑 내가 맞춰야 하는 문제의 개수 M이 주어져. N과 M은 1보다 크거나 같고, 100,000보다 작거나 같은 자연수인데, 자연수가 뭔지는 알지? 모르면 www.acmicpc.net // 회사에 있는 사람 #include #include #include #include #include using namespacestd; intmain() { ios::sync_with_stdio(0),cin.tie(0); unordered_mapmap; intsize, n; stringinput; vectordogam; cin >> size >> n; dogam.p..

백준 7785 (c++) 회사에 있는 사람
<algorithm>/백준 2023. 4. 6. 17:11

https://www.acmicpc.net/problem/7785 7785번: 회사에 있는 사람 첫째 줄에 로그에 기록된 출입 기록의 수 n이 주어진다. (2 ≤ n ≤ 106) 다음 n개의 줄에는 출입 기록이 순서대로 주어지며, 각 사람의 이름이 주어지고 "enter"나 "leave"가 주어진다. "enter"인 경우는 www.acmicpc.net // 회사에 있는 사람 #include #include #include #include #include using namespacestd; intmain() { ios::sync_with_stdio(0),cin.tie(0); unordered_setset; stringname, status; intn; cin >> n; while (n--) { cin >> ..

백준 1744 (c++) 수 묶기
<algorithm>/백준 2023. 3. 23. 11:39

https://www.acmicpc.net/problem/1744 // 수 묶기 #include #include #include using namespacestd; intmain() { ios::sync_with_stdio(0),cin.tie(0); intn, zero = 0,res = 0, plus_idx = -1; cin >> n; vectorplus, minus; for (int i = 0; i > num; if (num == 1) // 1은 곱하면 쌉손해 res++; else if (num == 0) // 0은 음수가 홀수일때 하나 처리해 주기 위해 필요 zero = 1; else if (num < 0) minus.push_back(num); else ..

백준 1700 (c++) 멀티탭 스케줄링
<algorithm>/백준 2023. 3. 22. 20:21

https://www.acmicpc.net/problem/1700 1700번: 멀티탭 스케줄링 기숙사에서 살고 있는 준규는 한 개의 멀티탭을 이용하고 있다. 준규는 키보드, 헤어드라이기, 핸드폰 충전기, 디지털 카메라 충전기 등 여러 개의 전기용품을 사용하면서 어쩔 수 없이 각종 전 www.acmicpc.net #include #include #include // 입출력 가능하게 하는 헤더 using namespacestd; vectorplug, input; intn, k; intcnt = 0; intfind_device(inttarget) { intres = 0; for (int i = 0; i < plug.size(); i++) if (plug[i] == target) res = 1; return (..