본문 바로가기
반응형

전체 글572

[안드로이드] 커스터마이징에 유용한 버튼 참고자료: https://boilerplate.tistory.com/51 버튼에 Ripple 효과 적용하기 Android 버튼에 Ripple Effect를 주는 방법에 대해서 알아보도록 하겠습니다. 먼저 결론부터 말해보자면, 2가지 방법을 추천합니다. 1) MaterialButton, MaterialCardView 를 사용하는 방법 (Android Support Desi.. boilerplate.tistory.com 일반 버튼보다 MaterialButton, MaterialCardView를 쓰는 것이 디자인 커스터마이징에 더 유용하다! 2021. 8. 4.
[안드로이드] 뷰페이저2 - 옆 프래그먼트 미리 보여주기 뷰페이저2를 xml 상에서 설정하고 id를 pager로 설정해준 상태다. val pagerWidth = resources.getDimensionPixelOffset(R.dimen.pagerWidth) val screenWidth = resources.displayMetrics.widthPixels val pagerPadding = ((screenWidth - pagerWidth ) * 0.5).toInt() val offsetPx = ((screenWidth - pagerWidth)* 0.25).toInt() pager.clipToPadding = false pager.clipChildren = false pager.setPadding(pagerPadding, 0, pagerPadding, 0) page.. 2021. 8. 4.
[ 최소 신장 트리 ] 백준 1922번: 네트워크 연결 / 골드 4 https://www.acmicpc.net/problem/1922 1922번: 네트워크 연결 이 경우에 1-3, 2-3, 3-4, 4-5, 4-6을 연결하면 주어진 output이 나오게 된다. www.acmicpc.net def find(parent, x): if parent[x] != x: parent[x] = find(parent, parent[x]) return parent[x] def union(parent, a, b): a = find(parent, a) b = find(parent, b) if a < b: parent[b] = a else: parent[a] = b import sys n = int(input()) m = int(input()) parent = [0]*(n+1) edges = .. 2021. 7. 29.
[투 포인터] 백준 2467번: 용액 / 골드 5 https://www.acmicpc.net/problem/2467 2467번: 용액 첫째 줄에는 전체 용액의 수 N이 입력된다. N은 2 이상 100,000 이하의 정수이다. 둘째 줄에는 용액의 특성값을 나타내는 N개의 정수가 빈칸을 사이에 두고 오름차순으로 입력되며, 이 수들은 모두 - www.acmicpc.net n = int(input()) lst = list(map(int, input().split())) if lst[0] >= 0: # all elem is positive print(lst[0], lst[1]) quit() if lst[-1] 0: right -= 1 new = abs(lst[left] + lst[right]) if new 2021. 7. 29.
[구현] 백준 2638번: 치즈 / 골드 4 https://www.acmicpc.net/problem/2638 2638번: 치즈 첫째 줄에는 모눈종이의 크기를 나타내는 두 개의 정수 N, M (5 ≤ N, M ≤ 100)이 주어진다. 그 다음 N개의 줄에는 모눈종이 위의 격자에 치즈가 있는 부분은 1로 표시되고, 치즈가 없는 부분은 0으로 www.acmicpc.net x_lim, y_lim = map(int, input().split()) # count the initial num of cheese cheese = 0 graph = [] for i in range(x_lim): row = list(map(int, input().split())) graph.append(row) for j in range(y_lim): if row[j] == 1: c.. 2021. 7. 28.
[누적합] 백준 11660번: 구간 합 구하기 5 / 실버 1 https://www.acmicpc.net/problem/11660 11660번: 구간 합 구하기 5 첫째 줄에 표의 크기 N과 합을 구해야 하는 횟수 M이 주어진다. (1 ≤ N ≤ 1024, 1 ≤ M ≤ 100,000) 둘째 줄부터 N개의 줄에는 표에 채워져 있는 수가 1행부터 차례대로 주어진다. 다음 M개의 줄에는 네 www.acmicpc.net import sys n, m = map(int, input().split()) table = [] for i in range(n): row = list(map(int, sys.stdin.readline().split())) for j in range(1, n): row[j] += row[j-1] table.append(row) for x in range(.. 2021. 7. 26.
반응형