코딩(89)
-
백준 [ALGORITHM] - 좌표 정렬하기2 (11651)
import sysN = int(sys.stdin.readline())lst = []for i in range(N): tmp_get = list(map(int, sys.stdin.readline().split())) lst.append(tmp_get)lst.sort(key=lambda x: (x[1], x[0])) for i in range(len(lst)): print(lst[i][0], lst[i][1])
2024.12.11 -
백준 [ALGORITHM] - 수 이어 쓰기 1 (1748)
n = int(input())length = 0digit = 1start = 1while start
2024.12.10 -
백준 [ALGORITHM] - 알파벳 개수 (10808)
#include #include using namespace std;int main() { string getArr; int alphabet[26] = {0}; getline(cin, getArr); for(char c : getArr) { alphabet[c - 'a']++; } for(int i=0;i
2024.12.06 -
백준 [ALGORITHM] - 수들의 합2 (2003)
N, M = map(int, input().split())A = list(map(int, input().split()))start = 0end = 0current_sum = 0count = 0while end M: current_sum -= A[start] start += 1 else: count += 1 current_sum -= A[start] start += 1print(count)
2024.12.05 -
백준 [ALGORITHM] - 2차원 배열의 합 (2167)
N, M = map(int, input().split())address = []for _ in range(N): temp_num = list(map(int, input().split())) address.append(temp_num)prefix_sum = [[0] * (M + 1) for _ in range(N + 1)]for i in range(1, N + 1): for j in range(1, M + 1): prefix_sum[i][j] = ( address[i-1][j-1] + prefix_sum[i-1][j] + prefix_sum[i][j-1] - prefix_sum[i-1][j-1] ..
2024.12.05 -
백준 [ALGORITHM] - 계산기 프로그램 (5613)
import operatordef calc_operator(operators, values): op = operators.pop() b = values.pop() a = values.pop() values.append(ops[op](a, b))ops = { '+' : operator.add, '-' : operator.sub, '*' : operator.mul, '/' : lambda x, y: x // y, }calc_data = []while True: input_data = input() if input_data == '=': try: values = [] opera..
2024.11.21