프로그래밍/Baekjoon52 (C++) 백준 알고리즘 1074번 Z 문제풀이 (C++) 123456789101112131415161718192021222324252627282930#include #include using namespace std; int N, r, c, cnt; void recursion(int row, int col, int range){ if (row == r && col == c){ cout N >> r >> c; recursion(0, 0, pow(2, N)); return 0;}Colored by Color Scriptercs example 문제 출처https://www.acmicpc.net/problem/1074 2019. 2. 19. (C++) 백준 알고리즘 7576번 토마토 문제풀이 (C++) 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081#include #include #include using namespace std; bool check[1003][1003] = {false,};int dist[1003][1003];int box[1003][1003];int dx[] = {0,0,1,-1};int dy[] = {1,-1,0,0}; int main(){ int M, N; int i,j; scanf("%d %d",&M,&N); for(i = 0; i 2019. 2. 12. (C언어) 백준 알고리즘 1157번 단어 공부 문제풀이 (C언어) 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758#include #include #include #define MAX 1000000 void upper(char *str); int alpha[26] = {0,}; int main(){ char word[MAX]; int i, index; int max = 0; int flag = 0; int len; scanf("%s", word); upper(word); len = strlen(word); for(i = 0; i 2019. 2. 11. (파이썬) 백준 알고리즘 2675번 문자열 반복 문제풀이 (Python) 1234567T = int(input()) for i in range(T): R, S = input().split() for k in S: print(k*int(R), end='') print()cs문제 출처https://www.acmicpc.net/problem/2675 2019. 1. 26. (파이썬) 백준 알고리즘 10809번 알파벳 찾기 문제풀이 (Python) 1234567891011S = input()check = [-1]*26 for i in range(len(S)): if check[ord(S[i])-97] != -1: continue else: check[ord(S[i])-97] = i for i in range(26): print(check[i], end=' ')cs소문자 a는 아스키코드로 97이다.문자를 아스키코드로 변환하여 97을 뺀 인덱스에 문자열 위치를 입력해준다.ex a=97 이므로 97-97 = 0 이여서 check[0]에 문자열의 위치 i를 넣어준다. 문제 출처https://www.acmicpc.net/problem/10809 2019. 1. 26. (파이썬) 백준 알고리즘 2839번 설탕 배달 문제풀이 (Python) 1234567891011121314151617181920212223n = int(input())# 초기화five = 0three = 0 # 최대 5kg의 갯수와 나머지를 구한다.five = n//5b = n%5 # 나머지가 0이 아니면 3kg 갯수를 구한다.if b !=0: while five >= 0: if b%3 == 0: three = b//3 break five -= 1 b += 5 ret=five + three if ret 2019. 1. 23. 이전 1 2 3 4 5 ··· 9 다음