Problem-solving/백준29 백준 - 한수(1065번) (Python3) import sys sys.setrecursionlimit(10000) # 1000 이하의 자연수 N 입력받음 (문자열 형태) N = input() total_count_of_han_number_int = 0 # 현재 문자열 형태의 숫자가 한수인지 체크 def is_han_number(number_to_check_str): if len(number_to_check_str) == 1: return True diff = int(number_to_check_str[1]) - int(number_to_check_str[0]) for num_index in range(1, len(number_to_check_str) - 1): if int(number_to_check_str[num_index + 1]) - \ i.. 2020. 5. 13. 백준(Baekjoon) 1541 C++ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 #include #include using namespace std; /* ex) (50 + 30 + 10) - (6 + 4 + 35 + 13) - (35 + 1 + 0 + 2) - (15 + 57) 알고리즘 : '-'문자 이후의 모든 숫자들을 빼면 된다. 연산자의 다음부터 0이 아닌 숫자 이전에 0이 .. 2020. 2. 27. 백준(Baekjoon) 1120 C++ 12345678910111213141516171819202122232425262728293031323334353637#include #include #include using namespace std; string A, B; int result = 50; // A와 B의 차이 최소값 void solve(){ for(int i = 0; i B;} int main(void){ ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); input(); solve(); return 0;}Colored by Color Scriptercs 2020. 2. 26. 백준(Baekjoon) 2875 C++ 2020. 2. 24. 이전 1 2 3 4 5 6 7 8 다음