일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- datastructure
- Stack
- 이스케이프 문자
- 이것이 자바다
- R
- C programming
- Algorithm
- list 컬렉션
- 윤성우 열혈자료구조
- 혼자 공부하는 C언어
- Selection Sorting
- 윤성우의 열혈 자료구조
- buffer
- insertion sort
- Graph
- Serialization
- C 언어 코딩 도장
- 메모리구조
- JSON
- coding test
- s
- 알기쉬운 알고리즘
- stream
- Today
- Total
목록Problem Solving (182)
Engineering Note

it 취업을 위한 알고리즘 문제 풀이 문제 코드 import sys #sys.stdin = open("input.txt","rt") n,m = map(int,input().split()) cnt = [0]*(n+m+1) for i in range(1,n+1): for j in range(1,m+1): cnt[i+j] += 1 #maxCnt = max(sum) maxCnt = 0 for i in range(len(cnt)): if maxCnt < cnt[i]: maxCnt = cnt[i] ##인덱스 값이 아니라 직접 x에 각 요소를 저장하여 최대값 구하기 # for x in cnt: # if maxCnt < x: # maxCnt = x for i in range(len(cnt)): if cnt[i] == ..

it 취업을 위한 알고리즘 문제 풀이 문제 코드 import sys #sys.stdin = open("input.txt","rt") n = int(input()) num = list(map(int,input().split())) def digit_sum(x): digitSum = 0 while x: digitSum += x %10 x //= 10 return digitSum #파이썬 문자열 변환 함수 str을 이용해서 자리수 합 구하기 #def digit_sum(x): # digitSum = 0 # for i in str(x): # digitSum += int(i) # return digitSum max = -1 for i in range(n): total = digit_sum(num[i]) if tot..

it 취업을 위한 알고리즘문제풀이 문제 코드 import sys #sys.stdin = open("input.txt","rt") n = int(input()) grade = list(map(int,input().split())) delta = [0]*len(grade) cnt = 0 minNum = 9999999 avg = 0 sum = 0 for i in range(len(grade)): sum += grade[i] avg = int(sum/n + 0.5) #print(avg) min = float('inf') for i in range(len(grade)): delta[i] = abs(grade[i] - avg) if(delta[i]< min): min = delta[i] #print(..

it 취업을 위한 알고리즘 문제 풀이 문제 코드 import sys sys.stdin = open("input.txt","rt") n,k = map(int,input().split()) card = list(map(int, input().split())) res = set() for i in range(n): for j in range(i+1,n): for m in range(j+1,n): res.add(card[i]+card[j]+card[m]) res = list(res) res.sort(reverse = True) print(res[k-1]) 문제해결방법 카드 3장을 뽑아 구할수 있는 모든 합을 구하고 중복을 제거한 형태의 K번째 큰 수를 구해야 하므로 set 자료구조를 사용했다. 3중 for문으로..
문제 https://leetcode.com/problems/human-traffic-of-stadium/ Human Traffic of Stadium - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 코드 문제해결방법
문제 https://leetcode.com/problems/classes-more-than-5-students/ Classes More Than 5 Students - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 코드 문제해결방법
https://leetcode.com/problems/exchange-seats/
it 취업을위한알고리즘문제풀이 문제 https://www.acmicpc.net/problem/2753 코드 #include int main(){ int year = 0; scanf("%d",&year); if(year % 4 ==0 && year % 100 != 0 || year % 400 ==0) printf("1"); else printf("0"); return 0; } 문제해결방법 논리연산자를 이용해서 해결했다. 문제에서 주어진 년도를 yeqr 변수에 저장한다. year가 4의 배수이면서 100의 배수가 아닌지(조건 A) 판단하고 또는 400의 배수인지(조건 B) 판단해서 조건 A 또는 B가 만족하면 윤년이므로 1을 출력하고 이 조건이 만족하지 않으면 0을 출력하도록 했다. 이때 윤년이기 위해서는 ..