알고리즘/킥스타트
-
구글 킥스타트(Kickstart) 2021 Round B 문제풀이알고리즘/킥스타트 2021. 6. 29. 00:32
킥스타트 : https://codingcompetitions.withgoogle.com/kickstart Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 한동안 구글 킥스타트를 까먹고 있다가 오랜만에 풀어봤다. 확실히 구글배 알고리즘문제들은 알고리즘 지식을 묻기보다는 알고리즘적 사고력을 묻는듯한 문제들로 이루어져있다. 그래서 확실히 더 어렵게 느껴지긴 하다..
-
구글 킥스타트(Kickstart) 2021 Round A 문제풀이알고리즘/킥스타트 2021. 3. 24. 00:25
문제 풀고 나중에 혼자 다시볼겸 남기는 포스트 Prob.1 K-Goodness String 입력 받은 문자열을 좌우대칭이 되게 만드는게 목표 그냥 깊게 생각할것도 없이 좌우 끝으로 부터 하나씩 비교하면서 서로 다른 경우 횟수를 기록해주고 이 횟수와 주어진 K와의 차가 답이 된다 test_n = int(input()) for tn in range(test_n): string_len, k = map(int, input().split(' ')) string = input() score = 0 ans = 0 for i in range(0, int(string_len/2)): if string[i] != string[string_len-i-1]: score += 1 ans = abs(score - k) print..