a = [] for i in range(10): num = int(input()) a.append(num%42) # 나머지를 리스트에 넣음 a = list(set(a)) # 중복제거 print(len(a)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); HashSet h..
T = int(input()) for i in range(T): H, W, N = map(int, input().split()) X = int(N/H)+1 #호수 Y = N % H # 높이 if Y == 0: Y = H X -= 1 print(str(Y) + str(X).zfill(2)) ▼ 링크 https://www.acmicpc.net/problem/10250
A, B, V = map(int, input().split()) day = (V-B)/(A-B) if day == int(day): print(int(day)) else: print(int(day)+1) ▼링크 https://www.acmicpc.net/problem/2869
X = int(input()) num = 1 cnt = 0 while X > cnt: cnt += num num += 1 #while문을 빠져나온 뒤의 num은 분수의 분모 분자를 합한 값 if num % 2 == 0: top = 1 bottom = num - 1 for i in range(cnt-X): top += 1 bottom -= 1 else: top = num-1 bottom = 1 for i in range(cnt-X): top -= 1 bottom += 1 print(str(top)+"/"+str(bottom)) ▼링크 https://www.acmicpc.net/problem/1193
N = int(input()) cnt = 1 sum = 1 while N > sum: sum += cnt*6 cnt += 1 print(cnt) ▼링크 https://www.acmicpc.net/problem/2292
A, B, C = list(map(int, input().split())) # 1000 + (70*n) 0: result = int(A / (C-B)) + 1 print(result) ▼링크 https://www.acmicpc.net/problem/1712
n = int(input()) result = 0 for i in range(n): line = input() a = {} # 빈 딕셔너리 생성 count = 0 for j in range(len(line)): if line[j] in a and a[line[j]] == (j-1): #문자가 연속해서 나타날 경우 a[line[j]] = j elif line[j] in a and a[line[j]] != (j-1): #문자가 연속하지 않을 경우 break else: #문자가 딕셔너리에 없는 경우 딕셔너리에 추가 a[line[j]] = j count += 1 if count == len(line): result += 1 print(result) import java.io.BufferedReader; impo..
★다시 a = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z='] b = input() for i in a: b = b.replace(i, 'a') print(len(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] croatia = {"c=", "c-", "..
word = input() num = ['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQRS', 'TUV', 'WXYZ'] sum = len(word) for i in range(len(word)): for j in num: if word[i] in j: sum += (num.index(j)+2) print(sum) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedRead..
line = input()[::-1] a, b = line.split() if int(a) >= int(b): print(a) else: print(b) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] num = br.readLine().split(" "); br.close(); for(int i=0;..