일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SW Expert Academy
- github
- 캐치카페
- hackerrank
- 데이콘
- AI 경진대회
- PYTHON
- 맥북
- 프로그래머스 파이썬
- 프로그래머스
- Git
- 백준
- 편스토랑 우승상품
- dacon
- 금융문자분석경진대회
- Docker
- ChatGPT
- Kaggle
- Baekjoon
- programmers
- gs25
- 자연어처리
- ubuntu
- 더현대서울 맛집
- leetcode
- 코로나19
- 우분투
- Real or Not? NLP with Disaster Tweets
- 편스토랑
- 파이썬
- Today
- Total
목록
반응형
2020/07 (46)
솜씨좋은장씨
nipa에서 GPU 서버를 지원받고 KorQuAD 1.0을 시도해보면서 얼마나 GPU를 사용하는지 보기위해서 $ nvidia-smi 명령어를 계속 입력하다가 쉘스크립트를 통해 1초에 1번씩 업데이트를 하도록 할 수 있지 않을까? 하여 찾아보니 원하는 시간 마다 반복하여 명령어를 수행하는 방법이 있었습니다. while true; do nvidia-smi; sleep 1; clear; done 위의 명령어를 사용하면 1초에 한번 씩 nvidia-smi 명령 실행 후 터미널의 화면을 한번 지웠다 다시 nvidia-smi 명령을 실행합니다. nvidia-smi 이외에 다른 명령어를 n초마다 반복하여 실행을 원한다면 다음과 같이 작성하면 됩니다. while true; do 실행을 희망하는 명령어; sleep 반복..
우분투 서버 사용 시 비밀번호 변경 방법입니다. $ passwd 위의 명령어를 활용하여 비밀번호 변경 절차를 실시합니다. Changing password for ubuntu. (current) UNIX password: New password: Retype new password: passwd: password updated successfully 현재의 비밀번호를 한번 입력한 뒤 새로 변경할 비밀번호를 두번 입력 (새 비밀번호 입력/확인을 위한 재입력) 해주면 변경 완료입니다. 읽어주셔서 감사합니다!
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. Solution class Solution: def twoSum(self, nums: List[int], target: int) -> List[..
Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 Output: false Solution class Solution: def isPowerOfTwo(self, n: int) -> bool: answer = False pow_2s = [] for i in range(50): pow_2s.append(pow(2, i)) if n in pow_2s: answer = True return answer ..
For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For example, if X = 1231, then the array form is [1,2,3,1]. Given the array-form A of a non-negative integer X, return the array-form of the integer X+K. Example 1: Input: A = [1,2,0,0], K = 34 Output: [1,2,3,4] Explanation: 1200 + 34 = 1234 Example 2: Input: A = [2,7,4], K = 181 Output: [4,5,5] E..
The absolute difference between two integers, a and b, is written as |a - b|. The maximum absolute difference between two integers in a set of positive integers, elements, is the largest absolute difference between any two integers in elements. The Difference class is started for you in the editor. It has a private integer array (elements) for storing N non-negative integers, and a public intege..
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night. Given a list of non-negative integers representing the amount..
1일 1문제 153일차! 153일차의 문제는 백준의 1, 2, 3 더하기 입니다. 9095번: 1, 2, 3 더하기 문제 정수 4를 1, 2, 3의 합으로 나타내는 방법은 총 7가지가 있다. 합을 나타낼 때는 수를 1개 이상 사용해야 한다. 1+1+1+1 1+1+2 1+2+1 2+1+1 2+2 1+3 3+1 정수 n이 주어졌을 때, n을 1, 2, 3의 합으로 나타내는 www.acmicpc.net Solution loopN = int(input()) answers = [] for i in range(loopN): inputNum = int(input()) if inputNum == 1: answers.append(1) elif inputNum == 2: answers.append(2) elif input..
이 글은 새로운 방법을 알게 될 때 마다 계속 업데이트 할 예정입니다. 우리는 종종 별도의 설정없이 matplotlib으로 한글이 들어간 그래프를 그리고자 할때 아래와 같이 한국어가 ㅁ로 깨져서 나오는 것을 볼 수 있습니다. 이 글에서는 위처럼 matplotlib 활용 시 한글이 깨져나올 때 해결하는 방법에 대해서 적어보려 합니다. Mac OSX 1. matplotlib의 rcParams를 통해 전역 폰트 설정하기 먼저 matplotlib의 rcParams를 통해 전역 폰트를 설정해주는 방법입니다. 별도의 폰트 설치 없이도 가장 쉽게 설정할 수 있는 방법입니다. import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['axes.unic..
1일 1문제 152일차! 오늘의 문제는 백준의 알파벳 개수입니다. 10808번: 알파벳 개수 단어에 포함되어 있는 a의 개수, b의 개수, …, z의 개수를 공백으로 구분해서 출력한다. www.acmicpc.net Solution word_s = input() word_count_dic = {'a':0, 'b':0, 'c':0, 'd':0, 'e':0, 'f':0, 'g':0, 'h':0, 'i':0, 'j':0, 'k':0, 'l':0, 'm':0, 'n':0, 'o':0, 'p':0, 'q':0, 'r':0, 's':0, 't':0, 'u':0, 'v':0, 'w':0, 'x':0, 'y':0, 'z':0} index = ['a','b','c', 'd', 'e', 'f', 'g', 'h', 'i', ..
1일 1문제 151일차! 오늘의 문제는 알파벳 찾기 입니다. 10809번: 알파벳 찾기 각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다. 만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출 www.acmicpc.net Solution word_s = input() word_count_dic = {'a':0, 'b':0, 'c':0, 'd':0, 'e':0, 'f':0, 'g':0, 'h':0, 'i':0, 'j':0, 'k':0, 'l':0, 'm':0, 'n':0, 'o':0, 'p':0, 'q':0, 'r':0, 's':0, 't':0, 'u':0, 'v':0, 'w':0, 'x':0, 'y':0, '..
1일 1문제 150일차! 150일차의 문제는 백준의 2진수 8진수 입니다. 1373번: 2진수 8진수 첫째 줄에 2진수가 주어진다. 주어지는 수의 길이는 1,000,000을 넘지 않는다. www.acmicpc.net Solution print(oct(int(input(), 2))[2:]) SOMJANG/CODINGTEST_PRACTICE 1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub. github.com
1일 1문제 149일차! 149일차의 문제는 최소공배수 입니다. 1934번: 최소공배수 두 자연수 A와 B에 대해서, A의 배수이면서 B의 배수인 자연수를 A와 B의 공배수라고 한다. 이런 공배수 중에서 가장 작은 수를 최소공배수라고 한다. 예를 들어, 6과 15의 공배수는 30, 60, 90등이 있� www.acmicpc.net Solution def gcd(a, b): mod = a%b while mod > 0: a = b b = mod mod = a%b return b def lcm(a, b): return a*b//gcd(a,b) loopNum = int(input()) for i in range(loopNum): inputNums = input() inputNums = inputNums.spli..
1일 1문제 148일차! 148일차의 문제는 최대공약수와 최소공배수 입니다. 2609번: 최대공약수와 최소공배수 첫째 줄에는 입력으로 주어진 두 수의 최대공약수를, 둘째 줄에는 입력으로 주어진 두 수의 최소 공배수를 출력한다. www.acmicpc.net Solution inputNums = input() inputNums = inputNums.split() a = int(inputNums[0]) b = int(inputNums[1]) def gcd(a, b): mod = a%b while mod > 0: a = b b = mod mod = a%b return b def lcm(a, b): return a*b//gcd(a,b) print(gcd(a, b)) print(lcm(a, b)) SOMJANG/C..
1일 1문제 147일차! 147일차의 문제는 백준의 나머지 입니다. 10430번: 나머지 첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000) www.acmicpc.net Solution a,b,c= map(int, input().split()) print((a+b)%c) print((a%c + b%c)%c) print((a*b)%c) print((a%c * b%c)%c) SOMJANG/CODINGTEST_PRACTICE 1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub. github.com
1일 1문제 146일차! 오늘은 쉬어가는 타임! 백준의 8진수 2진수 입니다. 1212번: 8진수 2진수 첫째 줄에 8진수가 주어진다. 주어지는 수의 길이는 333,334을 넘지 않는다. www.acmicpc.net Solution print(bin(int(input(), 8))[2:]) SOMJANG/CODINGTEST_PRACTICE 1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub. github.com