분류 전체보기179 1100) 하얀 칸 (C++) 출처 https://www.acmicpc.net/problem/1100 내 풀이 #include using namespace std; int main() { char input[9][9]; int horse = 0; for (int i = 0; i > input[i][j]; if (input[i][j] == 'F') { if (i % 2 == 0 && j % 2 == 0) horse++; else if (i % 2 == 1 && j % 2 == 1) horse++; } } } cout 2022. 5. 19. 3034) 앵그리 창영 (C++) 출처 https://www.acmicpc.net/problem/3034 3034번: 앵그리 창영 첫째 줄에 던진 성냥의 개수 N과 박스의 가로 크기 W와 세로 크기 H가 주어진다. (1 ≤ N ≤ 50, 1 ≤ W, H ≤ 100) 다음 N개 줄에는 성냥의 길이가 주어진다. 길이는 1보다 크거나 같고 1000보다 작거나 www.acmicpc.net 내 풀이 #include using namespace std; int N = 0, W = 0, H = 0;//던진 성냥 개수, 박스 가로 크기, 세로 크기 int matches = 0;//성냥 int main() { cin >> N >> W >> H; //피타고라스의 정리 이용 int max_Income = (W * W) + (H * H); for (int i.. 2022. 5. 18. 11478) 서로 다른 부분 문자열의 개수 (C++) 출처 https://www.acmicpc.net/problem/11478 11478번: 서로 다른 부분 문자열의 개수 첫째 줄에 문자열 S가 주어진다. S는 알파벳 소문자로만 이루어져 있고, 길이는 1,000 이하이다. www.acmicpc.net 내 풀이 #include #include using namespace std; set sets; string input; string str; int main() { cin >> input; for (int i = 0; i < input.size(); i++) { for (int j = i; j < input.size(); j++) { str += input[j]; sets.insert(str); } str = ""; } cout 2022. 5. 17. 1269) 대칭 차집합 (C++) 출처 https://www.acmicpc.net/problem/1269 1269번: 대칭 차집합 첫째 줄에 집합 A의 원소의 개수와 집합 B의 원소의 개수가 빈 칸을 사이에 두고 주어진다. 둘째 줄에는 집합 A의 모든 원소가, 셋째 줄에는 집합 B의 모든 원소가 빈 칸을 사이에 두고 각각 주어 www.acmicpc.net 내 풀이 #include #include using namespace std; int A = 0, B = 0; int input = 0; int result = 0; mapmp; int main() { cin >> A >> B; int result = A; for (int i = 0; i > input; mp[input] = 1; } for (int i =.. 2022. 5. 17. 이전 1 ··· 8 9 10 11 12 13 14 ··· 45 다음