목록전체 글 (392)
HTD
git stash git checkout OTHER_BRANCH (OTHER_BRANCH에서 작업) git checkout ABC git stash apply
git checkout -b ABC (작업) git push origin ABC (Pull Request) git checkout master git merge ABC git push git branch -d ABC git remote update --prune git fetch git rebase master git checkout master git merge ABC git push origin main git remote update --prune
www.acmicpc.net/problem/2581 import sys input = sys.stdin.readline def isPrimeNumber(n): for i in range(2, int(n**(1/2))+1): if n % i == 0: return False return True M = int(input()) N = int(input()) isPrimeNumberList = [True]*(N+1) primeMin = 10001 primeSum = 0 for i in range(2, N+1): if isPrimeNumberList[i]: if not isPrimeNumber(i): isPrimeNumberList[i] = False continue isPrimeNumberList[i] = T..
www.acmicpc.net/problem/13460 import sys import copy input = sys.stdin.readline TOP, RIGHT, BOTTOM, LEFT = 0, 1, 2, 3 dx = [-1, 0, 1, 0] dy = [0, 1, 0, -1] def bfs(): global curMap, curRedPos, curBluePos todo = [[map, redPos, bluePos, 1]] # 2개의 구슬의 위치를 기록하여 중복을 허용하지 않도록 함 ballRecords = [[redPos, bluePos]] while todo: curOriginalMap, curOriginalRedPos, curOriginalBluePos, curCount = todo.pop( 0) ..
1. 라이브러리 임포트 using Unity.Notifications.Android; 2. OnApplicationPause() private void OnApplicationPause(bool pause) { if (pause) { #if UNITY_ANDROID //이전에 스케줄되었던 알림들 취소 AndroidNotificationCenter.CancelAllNotifications(); AndroidNotificationChannel notificationChannel = new AndroidNotificationChannel( "notification_channel1", "notification_title", "This is a notification", Importance.High ); Andr..
www.acmicpc.net/problem/1181 import sys input = sys.stdin.readline N = int(input()) words = set() for _ in range(N): words.add(input().rstrip()) words = list(words) words.sort() words.sort(key=lambda x: len(x)) for word in words: print(word) 우선 조건이 크게 두 개가 있다. 1. 조건에 따른 정렬 2. 중복된 문자는 1번만 출력함 일단 중복된 문자는 신경을 쓰지 않으므로, 순서는 없지만 중복을 허용하지 않는 집합(set)을 이용한다. 입력을 set()으로 초기화된 집합에 받아 중복을 걸러낸 이후에 이것을 리스트화 하..
www.acmicpc.net/problem/1874 N = int(input()) nums = [] for _ in range(N): nums.append(int(input())) stack = [] toPush = 1 toPrint = [] for num in nums: while toPush
www.acmicpc.net/problem/1011 1011번: Fly me to the Alpha Centauri 우현이는 어린 시절, 지구 외의 다른 행성에서도 인류들이 살아갈 수 있는 미래가 오리라 믿었다. 그리고 그가 지구라는 세상에 발을 내려 놓은 지 23년이 지난 지금, 세계 최연소 ASNA 우주 비행 www.acmicpc.net import sys input = sys.stdin.readline def setJumpCounts(maxIndex): global jumpCounts lastIndex = 1 i = 2 while lastIndex < maxIndex: rep = (i+1)//2 jumpCounts.append(jumpCounts[i-1]+rep) lastIndex = jumpCou..
www.acmicpc.net/problem/2206 import sys input = sys.stdin.readline dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def bfs(): global stepMap todo = [(0, 0, 0)] while todo: curPos = todo.pop(0) if curPos[1] == N-1 and curPos[2] == M-1: return stepMap[curPos[0]][curPos[1]][curPos[2]] for i in range(4): curX, curY = curPos[1] + dx[i], curPos[2] + dy[i] if 0
www.acmicpc.net/problem/1654 import sys input = sys.stdin.readline def getLanCountAfterCut(lans, cutBy): lanCountAfterCut = 0 for lan in lans: lanCountAfterCut += lan//cutBy return lanCountAfterCut K, N = map(int, input().split()) lans = [int(input()) for _ in range(K)] left, right = 1, max(lans) while left