분류 전체보기177 9996) 한국이 그리울 땐 서버에 접속하지 출처 https://www.acmicpc.net/problem/9996 내 풀이 더보기#includeusing namespace std;int N = 0;string pattern;string input;int main(){ cin >> N; cin >> pattern; int star = pattern.find('*'); string front = pattern.substr(0, star); string back = pattern.substr(star + 1, pattern.length() - 1); for (int i = 0; i > input; if (input.length() >= front.length() + back.length()) { string input_front = input.. 2025. 4. 5. 11655) ROT13 출처 https://www.acmicpc.net/problem/11655 내 풀이 더보기#include#includeusing namespace std;string input;int main(){ getline(cin, input); for (int i = 0; i = 'a' && input[i] = 'A' && input[i] 해설ROT13은 알파벳을 13글자씩 밀어 암호화하는 방식으로,소문자, 대문자를 각각 13글자 밀고알파벳 범위를 넘어가면 처음으로 돌아오는 순환 구조를 가짐 띄어쓰기나 숫자, 특수문자는 그대로 출력해야 하므로,getline을 사용하여 띄어쓰기가 포함된 한 줄 전체를 입력 받음.알파벳은 'a' 또는 'A'를 기준으로 0부터 인덱스를 맞추고,13을 더한 뒤 26으로 나눠서 범위.. 2025. 4. 5. 1159) 농구 경기 (문자열) 출처 https://www.acmicpc.net/problem/1159 내 풀이 더보기#include#include#includeusing namespace std;int N;vector player(26, 0);string result = "";int main(){ cin >> N; for (int i = 0; i > name; player[name[0] - 'a']++; if(player[name[0]-'a'] == 5) { result += name[0]; } } sort(result.begin(), result.end()); if (result.empty()) cout 느낀점 스무스.. 2025. 3. 30. 10988) 팰린드롬인지 확인하기 (reverse, 투포인터) 출처 https://www.acmicpc.net/problem/10988 내 풀이 Reverse더보기#include #include using namespace std; string A, B = ""; int main() { cin >> B; A = B; reverse(B.begin(), B.end()); if (A == B) cout else cout }투포인터 더보기#include #include using namespace std; // 투포인터 방식 int main() { string str; cin >> str; int left = 0; int right = str.size() - 1; while(left { if (str[left] != str[right]) { cout return 0;.. 2025. 3. 30. 이전 1 2 3 4 ··· 45 다음