top of page

게시판 게시물

Hazel
2024년 5월 12일
In 소스 코드 제출
# # 2014 # for i in range(0, 10): # for j in range(0, 10): # for k in range(0, 10): # if (i*100 + j*10 + k)-(i*10+j) == k*10 +k: # if i==j==k: # pass # else: # print(i, j, k, '-', i, j, '=', k, k, sep='') from audioop import reverse # #2016 # n=int(input()) # number=list(input()) # for i in range(n): # print(number[i], end='') # if i+1 == n: # pass # elif (n-i-1)%3 == 0: # print(",", end='') # # 1460 # n = int(input()) # biglist = [] # for i in range(n): # zeros = [0] * n # biglist.append(zeros) # for i in range(n): # for j in range(n): # biglist[i][j] = j+(n*i+1) # for i in range(n): # for j in range(n): # print(biglist[i][j], end=' ') # print() # # 1461 # n = int(input()) # biglist = [] # for i in range(n): # zeros = [0] * n # biglist.append(zeros) # for i in range(n): # for j in range(n): # biglist[i][j] = ((i+1)*n) - j # for i in range(n): # for j in range(n): # print(biglist[i][j], end=' ') # print() # # 1462 # n = int(input()) # biglist = [] # for i in range(n): # zeros = [0] * n # biglist.append(zeros) # for i in range(n): # for j in range(n): # biglist[i][j] = i+1 + (j*n) # for i in range(n): # for j in range(n): # print(biglist[i][j], end = ' ') # print() # # 1463 # n = int(input()) # biglist = [] # for i in range(n): # zeros = [0] * n # biglist.append(zeros) # for i in range(n): # for j in range(n): # biglist[i][j] = (n-i) + (j*n) # for i in range(n): # for j in range(n): # print(biglist[i][j], end=' ') # print() # # 1464 # n, m = map(int, input().split()) # biglist = [] # for i in range(n): # zeros = [0] * m # biglist.append(zeros) # for i in range(n): # for j in range(m): # biglist[i][j] = m * (n-i) - j # for i in range(n): # for j in range(m): # print(biglist[i][j], end=' ') # print() # #1465 TEACHER HELP!! (can solve the last questions with this: changing i, j, print order, range of print etc) # # n, m = map(int, input().split()) # k = 1 # # biglist = [] # for i in range(n): # z = [0] * m # biglist.append(z) # # for i in range(n): # for j in range(m): # biglist[i][j] = k # k += 1 # # for i in range(n-1, -1, -1): # for j in range(m): # 0, 1, 2, 3, ..., n-1 # print(biglist[i][j], end=' ') # print() # #1466 # n, m = map(int, input().split()) # k = 1 # biglist = [] # for i in range(n): # zeros = [0] * m # biglist.append(zeros) # for j in range(m): # for i in range(n): # biglist[i][j] = k # k += 1 # for i in range(n-1, -1, -1): # for j in range(m-1, -1, -1): # print(biglist[i][j], end=' ') # print() # # 1467 # n, m = map(int, input().split()) # k = 1 # biglist = [] # for i in range(n): # zeros = [0] * m # biglist.append(zeros) # for j in range(m): # for i in range(n): # biglist[i][j] = k # k += 1 # for i in range(n): # for j in range(m-1, -1, -1): # print(biglist[i][j], end=' ') # print() # # 1098 # h, w = map(int, input().split()) # n = int(input()) # board = [] # for i in range(h): # zeros = [0] * w # board.append(zeros) # for i in range(n): # for how many sticks there are # l, d, x, y = map(int, input().split()) # if d == 0: # for j in range(l): # board[x-1][y-1+j] = 1 # elif d == 1: # for j in range(l): # board[x-1+j][y-1] = 1 # for i in range(h): # for j in range(w): # print(board[i][j], end=' ') # print() # 6098 (ANT PROBLEM = TAKES A BIT OF TIME, USING 2D LIST, always looped (while True) and break + HARD board = [] for i in range(10): board.append(list(map(int, input().split()))) board[1][1] = 9 x = 1 y = 1 while True: # KEEP GOING!! UNTIL BREAK if board[x][y+1] == 2: # if food on right, move right once then STOP y += 1 board[x][y] = 9 break elif board[x][y+1] == 1: # look forward, if road bad if board[x+1][y] == 1: # if road down also block, STOP break elif board[x+1][y] == 0: # if road down is good, go down x += 1 board[x][y] = 9 elif board[x+1][y] == 2: # if road down is food, go down and STOP x += 1 board[x][y] = 9 break elif board[x][y+1] == 0: # look forward, if road good y += 1 # move right once board[x][y] = 9 for i in range(10): # printing formula (always used for j in range(10): print(board[i][j], end=' ') print()
0
0
1
Hazel
2024년 4월 21일
In 소스 코드 제출
# # Q 1508 HARD Q # n = int(input()) # biglist = [] # point = 0 # right = 0 # up = 0 # for i in range(n): # zeros = [0] * (i+1) # makes a 0 list in pyramid shape # biglist.append(zeros) # for i in range(n): # x = int(input()) # biglist[i][0] = x # first value is inputted # for i in range(1, n): # for j in range(1, len(biglist[i])): # because if it's just n, it will look over the pyramid as a box and will be out of range # biglist[i][j] = biglist[i][j-1] - biglist[i-1][j-1] # the current value will be the one on the right - the one on the top of the right # for i in range(n): # for j in range(len(biglist[i])): # print(biglist[i][j], sep='', end=' ') # this is to print values without the [,] list things # print() # # Q 1509 HARD Q # board = [] # life = 0 # for i in range(11): # line = list(map(int, input().split())) # board.append(line) # make the board according to input (11 lines) # for k in range(10): # k is horizontal # if board[10][k] == 1: # see if the horse is there (only print if there is a horse in the line) # for j in range(10): # if board[j][k] != 0: # saved the last value of the line instead of going from the bottom (right example is in green below) # life = board[j][k] # """ # should've been: # # for j in range(9, -1, -1): # life = board[j][k] # # because we need to go from the bottom and see obstacles # """ # if life < 0: # print(k+1, 'fall') # elif life > 0: # print(k+1, 'crash') # elif life == 0: # print(k+1, 'safe') # life = 0 # # # Q 1512 super confusing # n = int(input()) # x, y = map(int, input().split()) # x -= 1 # y -= 1 # for i in range(n): # for j in range(n): # px = 0 # py = 0 # if x > i: # every step below is to calculate 절대값 to add onto (bc no minus on the map) # px = x - i # else: # px = i - x # # if y > j: # py = y - j # else: # py = j - y # print(px + py + 1, end=' ') # instead of making an entire list, just print one number each into the shape of a table # print() # Q 1512 my version - entirely wrong (i could fix it but idk how) # if i>x-1: # if j>y-1: # jido[i][j] = 1 + (i-x-1) + (j-y-1) # else: # jido[i][j] = 1 + (i-x-1) + (y-1-j) # else: # if j>y-1: # jido[i][j] = 1 + (x-1-i) + (j-y-1) # else: # jido[i][j] = 1 + (x-1-i) + (y-1-j) # Q 1505 - HOMEWORK !!! AT HOME!! n = int(input()) snail = [] for i in range(n): row = [0] * n snail.append(row) direction = [[0, 1], [1, 0], [0, -1], [-1, 0]] """값넣을때 단일반복문이면 된다""" for i in range(n*n): snail[][] = for i in range(n): for j in range(n): print(snail[i][j], end=' ') print() # definitely wrong # for i in range(n): # snail[0][i] = i + 1 # nextone = snail[0][n-1] # for i in range(n): # snail[i][n-1] = nextone + i # nexttwo = snail[n-1][n-1] # for i in range(n-1,-1, -1): # snail[n-1][i] = nexttwo + i # nextthree = snail[n-1][0] # for i in range(n-2, 1, -1): # snail[i][0] = nextthree + i # for i in range(n-1): # for j in range(n-1): # print(snail[i][j])
0
0
3
Hazel
2024년 4월 14일
In 소스 코드 제출
# Q 6130 # line = input() ''' (FIRST TRY AT HOME) ax = int(line[0]) b = int(line[3]) if line[2] == '+': print('%.2f' % (-b/ax)) elif line[2] == '-': print('%.2f' % (b / ax)) ''' ''' (SECOND TRY AT ACADEMY) line = input() numbers = [] x = 0 plusminus = 0 ax = 0 b = 0 for i in range(len(line)): if line[i] != 'x' and line[i] != '+' and line[i] != '-' and line[i] != '=': numbers.append(int(line[i])) elif line[i] == 'x': x = i elif line[i] == '+' or line[i] == '-': plusminus = i for i in range(len(numbers)): if numbers[i] == line[x-1]: for j in range(len(line)): if i >= j: ax += numbers[j] print(numbers) print('%.2f' % (soommmeethiiing)) ''' ''' # THIRD TRY EXCEPT THE TEACHER WROTE EVERYTHING data = input() if data.__contains__('+'): front, end = data.split('+') front = front[:-1] # same as front[0:len(front)-1] = cuts out x front = int(front) end = int(end) print('%.2f'%(-end/front)) else: front, end = data.split('-') front = front[:-1] front = int(front) end = int(end) print('%.2f'%(end/front)) ''' # # 6131 # data = input() # if data.__contains__('+'): # front, bigend = data.split('+') # front = int(front[:len(front)-1]) # middle, end = bigend.split('=') # middle = int(middle) # end = int(end) # print('%.2f'% ((end-middle)/front)) # else: # front, bigend = data.split('-') # front = int(front[:len(front)-1]) # middle, end = bigend.split('=') # middle = int(middle) # end = int(end) # print('%.2f'% ((end+middle)/front)) # # Q 1411 # n = int(input()) # numbers = [] # allnumbers = [] # for i in range(n-1): # numbers.append(int(input())) # for i in range(1, n+1): # allnumbers.append(i) # for i in range(len(numbers)): # if allnumbers.__contains__(numbers[i]): # allnumbers.remove(numbers[i]) # print(allnumbers[0]) # TEACHER SOLVE # n = int(input()) # # data = [] # for i in range(n-1): # v = int(input()) # data.append(v) # # for i in range(1, n+1): # if i in data: # continue # continue goes back up / pass checks lower if etc # else: # print(i) # break # # 2차원배열 3 types (1st one is most likely wrong) # # 1st type: copies 9 onto each v appended, creating 00900 00900 00900 00900 00900 # data = [] # v = [0] * 5 # for i in range(5): # data.append(v) # data[2][2] = 9 # print(data) # # 2nd type: copies 9 onto that one 2,2 point in the 2D list data, 00000 00000 00900 00000 00000 # data = [] # for i in range(5): # v = [0] * 5 # data.append(v) # data[2][2] = 9 # print(data) # # 3rd type: same as 2nd but repeats putting in 0 instead # data = [] # for i in range(5): # data.append([]) #appends a list to the ;ist # for j in range(5): # data[i].append(0) #appends 0 inside the list inside the list # # Q 6095 # board = [] # for i in range(19): # v = [0] * 19 # board.append(v) # n = int(input()) # for i in range(n): # row, column = map(int, input().split()) # board[row-1][column-1] = 1 # # for i in range(19): # for j in range(19): # print(board[i][j], end=' ') # print() # 1511 # biglist = [] # n = int(input()) # for i in range(1, n*n + 1): # v = [i] # biglist.append(v) # print(biglist) # # Q 1511 # biglist = [] # n = int(input()) # bigadd = 0 # for i in range(n): # v = [0]*n # biglist.append(v) # for i in range(n): # for j in range(n): # biglist[i][j] = (i+1) * n + j - (n-1) # for i in range(n): # for j in range(n): # if i == 0 or j == 0 or i == n-1 or j == n-1: # bigadd += biglist[i][j] # print(bigadd)
0
0
8
Hazel
2024년 4월 07일
In 소스 코드 제출
# # Q4721 VERY VERY LONG Q # n = int(input()) # onestudent = [] # first = 0 # firstpoints = [] # second = 0 # secondpoints =[] # third = 0 # thirdpoints = [] # totalcomparison = [] # # for i in range(n): # onestudent = list(map(int, input().split())) # for j in range(3): # if j == 0: # first += onestudent[j] # firstpoints.append(onestudent[j]) # elif j == 1: # second += onestudent[j] # secondpoints.append(onestudent[j]) # elif j == 2: # third += onestudent[j] # thirdpoints.append(onestudent[j]) # # firstthree = firstpoints.count(3) # secondthree = secondpoints.count(3) # thirdthree = thirdpoints.count(3) # firsttwo = firstpoints.count(2) # secondtwo = secondpoints.count(2) # thirdtwo = thirdpoints.count(2) # # if first > second: # if first > third: # print('1', first) # elif third > first: # print('3', third) # if first == third: # if firstthree > thirdthree: # print('1', first) # elif firstthree == thirdthree: # if firsttwo > thirdtwo: # print('1', first) # elif thirdtwo > firsttwo: # print('3', third) # elif firsttwo == thirdtwo: # print('0', first) # elif thirdthree > firstthree: # print('3', third) # # elif second > first: # if second > third: # print('2', second) # elif third > second: # print('3', third) # elif second == third: # if secondthree > thirdthree: # print('2', second) # elif secondthree == thirdthree: # if secondtwo > thirdtwo: # print('2', second) # elif thirdtwo > secondtwo: # print('3', third) # elif thirdtwo == secondtwo: # print('0', second) # elif thirdthree > secondthree: # print('3', third) # # elif second > third: # if second > first: # print('2', second) # elif first > second: # print('1', first) # elif second == first: # if secondthree > firstthree: # print('2', second) # elif firstthree > secondthree: # print('1', first) # elif firstthree == secondthree: # if firsttwo > secondtwo: # print('1', first) # elif secondtwo > firsttwo: # print('2', second) # elif secondtwo == firsttwo: # print('0', second) # # elif third > second: # if third > first: # print('3', third) # elif first > third: # print('1', first) # elif third == first: # if thirdthree > firstthree: # print('3', third) # elif thirdthree == firstthree: # if thirdtwo > firsttwo: # print('3', third) # elif thirdtwo == firsttwo: # print('0', third) # elif thirdtwo < firsttwo: # print('1', first) # elif firstthree > thirdthree: # print('1', first) # # elif first == second and second == third: # if firstthree == secondthree and secondthree == thirdthree: # print('0', first) # elif firstthree > secondthree: # if thirdthree == firstthree: # print('0', first) # elif thirdthree > firstthree: # print('3', third) # else: # print('1', first) # elif secondthree > firstthree: # if secondthree == thirdthree: # print('0', second) # elif thirdthree > secondthree: # print('3', third) # else: # print('2', second) # else: # print('3', third) # # Q 4691 # n = int(input()) # money = 0 # biggestsolo = 0 # for i in range(n): # the entire trials # diceresults = list(map(int,input().split())) # for j in range(1,7): #for each row counting # if diceresults.count(j) == 4: # if (50000 + j*5000) > money: # money = 50000 + j*5000 # elif diceresults.count(j) == 3: # if (10000 + j*1000) > money: # money = 10000 + j*1000 # elif diceresults.count(j) == 2: # for k in range(1,7): #for counting 2 doubles # if diceresults.count(k) == 2 and k != j: # if (2000 + j*500 + k*500) > money: # money = 2000 + j*500 + k*500 # else: # if (1000 + j*100) > money: # money = 1000 + j*100 # else: # diceresults.sort() # biggestsolo = diceresults[3] # if biggestsolo*100 > money: # money = biggestsolo*100 # print(money) # # # # Q 4776 # n = int(input()) # number = 0 # alphabet = 'A' # number = (n-2014) % 10 # alphabet = (n-2008) % 12 + 1 # if alphabet == 1: # print('A', number, end='') # if alphabet == 2: # print('B', number, end='') # if alphabet == 3: # print('C', number, end='') # if alphabet == 4: # print('D', number, end='') # if alphabet == 5: # print('E', number, end='') # if alphabet == 6: # print('F', number, end='') # if alphabet == 7: # print('G', number, end='') # if alphabet == 8: # print('H', number, end='') # if alphabet == 9: # print('I', number, end='') # if alphabet == 10: # print('J', number, end='') # if alphabet == 11: # print('K', number, end='') # if alphabet == 12: # print('L', number, end='') # # # # # Q 4726 # totaldays, adddays = map(int, input().split()) # totaltemp = list(map(int,input().split())) # addedtemp = 0 # biggesttemp = 0 # for i in range(adddays): # totaltemp.append(0) # for i in range(len(totaltemp)): # for j in range(adddays): # addedtemp += totaltemp[i] # if addedtemp > biggesttemp: # biggesttemp = addedtemp # print(biggesttemp) # # # different try bc last try kinda failed # # Q 4726 # totaldays, adddays = map(int, input().split()) # totaltemp = list(map(int,input().split())) # for i in range(adddays): # totaltemp.append(0) # addedtemp = 0 # alladdedtemps = [] # for i in range(totaldays): # for j in range(adddays): # addedtemp += totaltemp[i+j] # alladdedtemps.append(addedtemp) # addedtemp = 0 # alladdedtemps.sort(reverse=True) # print(alladdedtemps[0]) # # # # # Q4536 # totaladded = 0 # allvalues = [] # choibeangap = [] # choibeangap.append(0) # choibeangap.append(0) # for i in range(10): # allvalues.append(int(input())) # totaladded += allvalues[i] # print(totaladded//10) # for i in range(10): # if allvalues.count(allvalues[i]) > choibeangap[1]: # choibeangap.clear() # choibeangap.append(allvalues[i]) # choibeangap.append(allvalues.count(allvalues[i])) # print(choibeangap[0]) # # # # Q4596 # onerow = [] # bigrow = [] # big = 0 # wherebig = [] # for i in range(9): # onerow = list(map(int, input().split())) # bigrow.append(onerow) # for i in range(9): # for j in range(9): # if bigrow[i][j] > big: # wherebig.clear() # big = bigrow[i][j] # wherebig.append(i) # wherebig.append(j) # print(big) # print(wherebig[0] + 1, wherebig[1] + 1) # n, r = map(int, input().split()) # top = 1 # bottom = 1 # for i in range(1, n+1): # top *= i # for i in range (1, r+1): # bottom *= i # for i in range (1, (n-r)+1): # bottom *= i # print (top//bottom) # # # Q 1406 # n = input() # if n == 'love': # print('I love you.') # # Q 1407 # words = input().split() # for i in range(len(words)): # print(words[i], end='') # # Q 2721 # good = 0 # first = input() # second = input() # third = input() # if first[len(first)-1] == second[0]: # good += 1 # if second[len(second)-1] == third[0]: # good += 1 # if third[len(third)-1] == first[0]: # good += 1 # # if good == 3: # print('good') # else: # print('bad') # # Q 1990 # n = int(input()) # if n % 3 == 0: # print('1') # else: # print('0') # # 1990 one more try # n = input() # total = 0 # number = 0 # for i in range(len(n)): # number = int(n[i]) # total += number # if total % 3 == 0: # print('1') # else: # print('0') # # Q 1419 # n = input() # howmany = n.count('love') # print(howmany) # # Q 1408 # original = input() # numberized = [] # firsttype = [] # secondtype = [] # for i in range(len(original)): # numberized.append(ord(original[i])) # # for i in range(len(original)): # firsttype.append(chr(numberized[i] + 2)) # for i in range(len(original)): # secondtype.append(chr((numberized[i]*7)%80 + 48)) # # for i in range(len(firsttype)): # print(firsttype[i], end='', sep='') # print() # for i in range(len(secondtype)): # print(secondtype[i], end='', sep='')
0
0
3
Hazel
2024년 3월 31일
In 소스 코드 제출
# # Q 1288 # n = int(input()) # numbers = list(map(int, input().split())) # comparison = [] # for i in range(n): # print(i+1, ": ", end='', sep='') # for j in range(n): # if j != i: # if numbers[i] > numbers[j]: # print("> ", end='') # elif numbers[i] < numbers[j]: # print("< ", end='') # elif numbers[i] == numbers[j]: # print("= ", end='') # print() # # Q 4592 # n = int(input()) # hundredcanvas = [] # # for i in range(105): # v = [0] * 105 # just in case bigger than 100 so when we get actual humane coordinates (starting from 1 not 0) it doesn't make errors # hundredcanvas.append(v) # make a 중첩 list with 100*100 list to count overlapping area # # for i in range(n): # the entire data inputted # x, y = map(int, input().split()) # one row of numbers inputted = one square's area # for j in range(x, x+10): # in the x range of the one square # for k in range(y, y+10): # not y+11 because y already works as 0 (starting number also counts) # hundredcanvas[j][k] = 1 # area = 0 # for i in range(101): # for j in range(101): # if hundredcanvas[i][j] == 1: # area += 1 # use this fancy 반복문 method bc hundredcanvas.count would only count 1 list line (this is a 중첩list instead of a simple 1-line list) # print(area) # # Q 4626 # n = int(input()) # rightorwrong = list(map(int, input().split())) # score = 0 # howmanyones = 0 # if rightorwrong[0] == 1: # score += 1 # howmanyones = 1 # for i in range(n-1): # to use rightorwrong[i+1], range should not exceed n # if rightorwrong[i+1] == 1: # if the current 채점 is one # if rightorwrong[i] == 0: # if the past 채점 was zero # score += 1 # add one to score # howmanyones = 1 # count that there was 1 one in the past # elif rightorwrong[i] == 1: # score += howmanyones + 1 # howmanyones += 1 # if rightorwrong[i+1] == 0: # score += 0 # howmanyones = 0 # print(score) # # Q 4726 - my method (takes shorter) # n, k = map(int, input().split()) # alltemp = list(map(int, input().split())) # addedtemp = 0 # alladdedtemp = [] # for i in range(n-k+1): # how many groups can be made (pattern is found by just trying it out) # for j in range(i, k+i): # what order of values of the list alltemp should be added in one group (0 to k, 1 to k+1, etc) # addedtemp += alltemp[j] # one "group" of added values using k (how many values of the list is added) # alladdedtemp.append(addedtemp) # add the group into the long list of all added group values to later compare the biggest # addedtemp = 0 # alladdedtemp.sort(reverse=True) # sort to reverse so the first value is the biggest # print(alladdedtemp[0]) # print the biggest value in all addedtemp groups' values # Q 4726 - teacher method n, k = map(int, input().split()) data = list(map(int, input().split())) m = -999999999999 # lower than -100 which is the min value from list "data" given in the Q = can compare the "data" values even if all is negative for i in range(n-k+1): # how many groups can be made (pattern found in trying it out) s = sum(data[i:i+k]) # listname[number1:number2] = listname[number1] to listname[number2 - 1] (ex. list[0:2] == list[0] to list[1]) if s > m: # if the sum of values from the list "data" from i to i+k is bigger than the previous value: m = s # save the sum of values (bc it means it's the biggest group value so far) print(m)
0
0
4
Hazel
2024년 3월 24일
In 소스 코드 제출
# HOMEWORK # # #Q4721 # n = int(input()) # first = 0 # firstlist = [] # second = 0 # secondlist = [] # third = 0 # thirdlist = [] # for i in range(n): # allvotepoints = list(map(int, input().split())) # first += allvotepoints[0] # firstlist.append(allvotepoints[0]) # second += allvotepoints[1] # secondlist.append(allvotepoints[1]) # third += allvotepoints[2] # thirdlist.append(allvotepoints[2]) # firstthree = firstlist.count(3) # firsttwo = firstlist.count(2) # secondthree = secondlist.count(3) # secondtwo = secondlist.count(2) # thirdthree = thirdlist.count(3) # thirdtwo = thirdlist.count(2) # compare = [] # compare.append(first) # compare.append(second) # compare.append(third) # compare.sort() # if compare[2] == compare[1]: # if firstthree > secondthree and firstthree > thirdthree: # print('1', compare[2]) # elif secondthree > firstthree and secondthree > thirdthree: # print('2', compare[2]) # elif thirdthree > secondthree and thirdthree > firstthree: # print('3', compare[2]) # else: # if firsttwo > secondtwo and firsttwo > thirdtwo: # print('1', compare[2]) # elif secondtwo > firsttwo and secondtwo > thirdtwo: # print('2', compare[2]) # elif thirdtwo > secondtwo and thirdtwo > firsttwo: # print('3', compare[2]) # elif firsttwo == secondtwo == thirdtwo: # print('0', compare[2]) # elif compare[2] == first: # print('1', compare[2]) # elif compare[2] == second: # print('2', compare[2]) # elif compare[2] == third: # print('3', compare[2]) # else: # print('0', compare[2]) # # # # # Q 4691 # n = int(input()) # money = 0 # biggestsolo = 0 # for i in range(n): # the entire trials # diceresults = list(map(int,input().split())) # for j in range(1,7): #for each row counting # if diceresults.count(j) == 4: # if (50000 + j*5000) > money: # money = 50000 + j*5000 # elif diceresults.count(j) == 3: # if (10000 + j*1000) > money: # money = 10000 + j*1000 # elif diceresults.count(j) == 2: # for k in range(1,7): #for counting 2 doubles # if diceresults.count(k) == 2 and k != j: # if (2000 + j*500 + k*500) > money: # money = 2000 + j*500 + k*500 # else: # if (1000 + j*100) > money: # money = 1000 + j*100 # else: # diceresults.sort() # biggestsolo = diceresults[3] # if biggestsolo*100 > money: # money = biggestsolo*100 # print(money) # # # Q 4776 # n = int(input()) # number = 0 # alphabet = 'A' # number = (n-2014) % 10 # alphabet = (n-2008) % 12 + 1 # if alphabet == 1: # print('A', number, sep='') # if alphabet == 2: # print('B', number, sep='') # if alphabet == 3: # print('C', number, sep='') # if alphabet == 4: # print('D', number, sep='') # if alphabet == 5: # print('E', number, sep='') # if alphabet == 6: # print('F', number, sep='') # if alphabet == 7: # print('G', number, sep='') # if alphabet == 8: # print('H', number, sep='') # if alphabet == 9: # print('I', number, sep='') # if alphabet == 10: # print('J', number, sep='') # if alphabet == 11: # print('K', number, sep='') # if alphabet == 12: # print('L', number, sep='') # # # # # Q 4726 # totaldays, adddays = map(int, input().split()) # totaltemp = list(map(int,input().split())) # addedtemp = 0 # biggesttemp = 0 # for i in range(adddays): # totaltemp.append(0) # for i in range(len(totaltemp)): # for j in range(adddays): # addedtemp += totaltemp[i] # if addedtemp > biggesttemp: # biggesttemp = addedtemp # print(biggesttemp) # # # different try bc last try kinda failed # # Q 4726 # totaldays, adddays = map(int, input().split()) # totaltemp = list(map(int,input().split())) # for i in range(adddays): # totaltemp.append(0) # addedtemp = 0 # alladdedtemps = [] # for i in range(totaldays): # for j in range(adddays): # addedtemp += totaltemp[i+j] # alladdedtemps.append(addedtemp) # addedtemp = 0 # alladdedtemps.sort(reverse=True) # print(alladdedtemps[0]) # # # # # Q4536 # totaladded = 0 # allvalues = [] # choibeangap = [] # choibeangap.append(0) # choibeangap.append(0) # for i in range(10): # allvalues.append(int(input())) # totaladded += allvalues[i] # print(totaladded//10) # for i in range(10): # if allvalues.count(allvalues[i]) > choibeangap[1]: # choibeangap.clear() # choibeangap.append(allvalues[i]) # choibeangap.append(allvalues.count(allvalues[i])) # print(choibeangap[0]) # # # # Q4596 # onerow = [] # bigrow = [] # big = 0 # wherebig = [] # for i in range(9): # onerow = list(map(int, input().split())) # bigrow.append(onerow) # for i in range(9): # for j in range(9): # if bigrow[i][j] > big: # wherebig.clear() # big = bigrow[i][j] # wherebig.append(i) # wherebig.append(j) # print(big) # print(wherebig[0] + 1, wherebig[1] + 1) # # # # # # # CLASSWORK # # # Q 4561 old ver. solved (wrong) # numbers = list(map(int,input())) # odds = [] # oddtotal = 0 # for i in range(7): # z = numbers[i] # if z % 2 == 1: # odds.append(z) # oddtotal += z # odds.sort() # if oddtotal == 0: # print('-1') # else: # print(oddtotal) # print(odds[0]) # # # Q 4561 resolved ver. # numbers = [] # odd = [] # totalodd = 0 # for i in range(7): # numbers.append(int(input())) # for i in range(7): # if numbers[i] % 2 == 1: # odd.append(numbers[i]) # totalodd += numbers[i] # odd.sort() # if totalodd == 0: # print('-1') # else: # print(totalodd) # print(odd[0]) # # # Q 4566 wrong ver. # m = int(input()) # n = int(input()) # allpossible = [] # prime = [] # for i in range(m,n+1): # allpossible.append(i) # allpossible.sort() # for i in range(m, n+1): # for j in range (m, n+1): # if allpossible[i] % j != 0: # if j != allpossible[i] and j != 1: # prime.append(allpossible[i]) # prime.sort() # total = 0 # for i in range(len(prime)): # total += prime[i] # print(total) # print(prime[0]) # # # Q 4566 resolved ver. # lowerbound = int(input()) # higherbound = int(input()) # oneprime = 0 # primesadded = 0 # allprimes = [] # for i in range(lowerbound, higherbound+1): # for j in range(2, i): # if i%j != 0: # if i != oneprime: # oneprime = i # allprimes.append(oneprime) # primesadded += oneprime # if primesadded == 0: # print('-1') # else: # print(primesadded) # allprimes.sort() # print(allprimes[0]) # # Q 4566 resolved ver. # lowerbound = int(input()) # higherbound = int(input()) # nottrue = 0 # oneprime = 0 # primesadded = 0 # allprimes = [] # if lowerbound == 1: # lowerbound = 2 # for i in range(lowerbound, higherbound+1): # i is any number between given values # for j in range(2, i): # testing if i is a prime number # if i % j == 0: # if i is not a prime number, # nottrue = i # name i so we know it's not prime # break # if i is found to be not a prime, we don't need to test the i anymore # if i != nottrue: # if i is NOT not a prime (is a prime) # primesadded += i # add the prime to the total # allprimes.append(i) # add the prime to the list of all added primes # if primesadded == 0: # if there is no prime number between the given numbers # print('-1') # else: # print(primesadded) # print the whole added total of prime numbers # allprimes.sort() # print(allprimes[0]) # print the smallest prime number between the given values # # # # # Q 4571 correct but for some reason time out (took too long to solve on computer) # min = int(input()) # max = int(input()) # jegopsu = 0 # total = 0 # all = [] # for i in range(min, max+1): # for j in range(1, max+1): # if j * j == i: # jegopsu = i # total += jegopsu # all.append(jegopsu) # break # all.sort() # if total == 0: # print('-1') # else: # print(total) # print(all[0]) # # # # wrong Q 4571 (완전제곱수) # min = int(input()) # max = int(input()) # allprimes = [] # totaladded = 0 # limitedprimes = [] # for i in range(2, 10000): # allprimes.append(i*i) # for i in range(min, max+1): # if allprimes.count(i) == 1: # totaladded += allprimes[i] # limitedprimes.append(allprimes[i]) # limitedprimes.sort() # print(totaladded) # print(limitedprimes[0]) # # # # correct Q 4571 완전제곱수 (teacher's help) # a = int(input()) # b = int(input()) # data = [] # for x in range(a, b+1): # for every value between given ones # for i in range(2, x): # divisors to check for each and every 완전제곱수 후보 x # if x/i == i: # IF i is the divisor of the 완전제곱수 x, # data.append(x) # now we know that x is the 완전제곱수. append it to our list of 완전제곱수. # break # no need to test for different divisors when x is already found to be 완전제곱수 # data.sort() # order the 완전제곱수s so we can find the smallest value # if a == 1 and b == 1: # just in case when the min and max values are 1, then we should just say 1 is the 완전제곱수 # print ('1') # print ('1') # elif sum(data) == 0: # if there is no 완전제곱수, print -1 # print('-1') # else: # print(sum(data)) # the total sum of the 완전제곱수s # print(data[0]) # finding the smallest 완전제곱수
0
0
4
Hazel
2024년 3월 17일
In 소스 코드 제출
Q 4751 super long some unsolved/wrong questions # Q 4031 # numbers = list(map(int, input().split())) # b = 0 # c = 0 # for i in range(7): # a = numbers[i] # if a % 2 == 1: # if a > b: # b = 0 # b += a # if a % 2 == 0: # if a > c: # c = 0 # c += a # print(b+c) # # # # Q 4036 # n = int(input()) # m = int(input()) # a = 0 # b = 0 # for i in range (1000001, 1, -1): # c = i # a # d = n - c #b # if c - d == m: # a = c # b = d # break # print(a) # print(b) # # # # # Q 4041 # a = list(input()) # b = 0 # c = 0 # for i in range(len(a)): # z = int(a[i]) # b += z 10 * i # c += z # print(b) # print(c) # # # # Q 4501 # height = [] # for i in range(7): # height.append(int(input())) # height.sort() # height.sort(reverse=True) # a = height[0] # b = height[1] # print(a) # print(b) # # # # Q 4506 # a, b = input().split() # a = int(a) # b = int(b) # for i in range(1, 10001): # if a % i == 0: # if b % i == 0: # c = 0 # c += i # print(c) # d = (a*b)//c # print(d) # # # # Q 4051 # money = 0 # totaltime = 0 # for i in range (5): # a, b = input().split() # a = float(a) # b = float(b) # c = b-a # time = c-1 # if time < 0: # time = 0 # elif time > 4: # time = 4 # totaltime += time # money += (time/0.5)*5000 # if totaltime >= 15: # money -= money*0.05 # elif totaltime <= 5: # money += money*0.05 # print(int(money)) # # # # Q4531 # numbers = [] # for i in range(5): # numbers.append(int(input())) # numbers.sort() # d = numbers[2] # c = 0 # for i in range(5): # c += numbers[i] # c = c // 5 # print (c) # print (d) # # # # Q 4591 # numbers = [] # order = [] # for i in range(9): # numbers.append(int(input())) # order.extend(numbers) # numbers.sort() # print(numbers[8]) # print((order.index(numbers[8])) + 1) # # # # Q4056 # money = int(input()) # if money <= 500: # money = money*0.7 # elif 500 < money <= 1500: # money = 350 + ((money-500)*0.4) # elif 1500 < money <= 4500: # money = 750 + ((money-1500)*0.15) # elif 4500 < money <= 10000: # money = 1200 + ((money-4500)*0.05) # elif money > 10000: # money = 1475 + ((money-10000)*0.02) # print(int(money//1)) # # # # Q 4561 # numbers = list(map(int, input())) # odds = [] # oddtotal = 0 # for i in range(7): # z = numbers[i] # if z % 2 == 1: # odds.append(z) # oddtotal += z # odds.sort() # if oddtotal == 0: # print('-1') # else: # print(oddtotal) # print(odds[0]) # # # # Q4566 # m = int(input()) # n = int(input()) # allpossible = [] # prime = [] # for i in range(m,n+1): # allpossible.append(i) # allpossible.sort() # for i in range(m, n+1): # for j in range (m, n+1): # if allpossible[i] % j != 0: # if j != allpossible[i] and j != 1: # prime.append(allpossible[i]) # prime.sort() # total = 0 # for i in range(len(prime)): # total += prime[i] # print(total) # print(prime[0]) # # # # Q4571 # m = int(input()) # n = int(input()) # jegopsu = [] # for i in range(m, n+1): # for j in range(m, n+1): # if i / j == j: # jegopsu.append(i) # jegopsu.sort() # z = 0 # for i in range(len(jegopsu)): # z += int(jegopsu[i]) # print(z) # print(jegopsu[0]) # # # # Q4592 # n = int(input()) # for i in range(n): # leftx = int(input()) # downy = int(input()) # rightx = leftx + 10 # upy = downy + 10 # for j in range(leftx, rightx): # for k in range(downy, upy): # # 어떻게 겹치는지, 어디의 자리를 차지하는지 알리는 방법을 모르겠다 # # # # Q4626 # n = int(input()) # point = 0 # for i in range(n): # if n[i+1] == 1: # if n[i] == 0: # point+=1 # elif n[i] == 1: # #어떻게 연속문제 맞기를 표현해야할지 모르겠다 # for i in range(len(point)): # z += int(point[i]) # print(z) # # # # Q4621 # n, m = map(int, input().split()) # yaksu = [] # for i in range(1,n+1): # if n % i == 0: # yaksu.append(i) # yaksu.sort() # if len(yaksu) < m: # print('0') # else: # print(yaksu[m-1]) # # # # # # # Q4681 # numbers = input().split() # gumjeung = 0 # for i in range(5): # z = int(numbers[i]) # gumjeung += z*z # print(gumjeung%10) # # # # Q4891 # rnhour, rnmin = map(int, input().split()) # addmin = int(input()) # min = rnmin + addmin # # # # # if addmin > 59: # addhour = addmin//60 # restmin = addmin%60 # if rnmin+restmin > 59: # if rnhour + addhour == 23: # print('0', rnmin+restmin-60) # elif rnhour + addhour > 23: # print(rnhour + addhour - 23, rnmin + restmin - 60) # else: # print(rnhour + addhour + 1, rnmin + restmin - 60) # elif rnhour == 23: # print(0 + addhour, rnmin + restmin) # elif rnhour + addhour > 23: # print(rnhour+addhour-24, rnmin+restmin) # else: # print(rnhour + addhour, rnmin + restmin) # # elif rnmin + addmin > 59: # if rnhour == 23: # print('0', min - 60) # else: # print(rnhour + 1, min - 60) # # else: # print(rnhour, min) # # # # Q4746 # rnhour, rnmin, rnsec = map(int, input().split()) # addsec = int(input()) # totalrnsec = rnhour*3600 + rnmin*60 + rnsec # addallsec = totalrnsec + addsec # newhour = addallsec // 3600 # newmin = (addallsec - newhour*3600) // 60 # newsec = addallsec - newhour*3600 - newmin*60 # if newhour > 23: # leftoverhour = newhour // 24 # print(newhour-24*leftoverhour, newmin, newsec) # else: # print(newhour, newmin, newsec) # # # # Q4651 # for i in range(1, 4): # throw = list(map(int, input().split())) # ones = throw.count(1) # if ones == 3: # print('A') # elif ones == 2: # print('B') # elif ones == 1: # print('C') # elif ones == 0: # print('D') # elif ones == 4: # print('E') # # # # #Q4891 # n = int(input()) # scores = list(map(int,input().split())) # scores.sort() # difference = scores[n-1] - scores[0] # print(difference) # # # # Q4751 (wrong) # n = int(input()) # wincountry = 0 # winnumber = 0 # winscore = 0 # secondcountry = 0 # secondnumber = 0 # secondscore = 0 # thirdcountry = 0 # thirdnumber = 0 # thirdscore = 0 # for i in range(n): # country, number, score = map(int, input().split()) # if wincountry == secondcountry == country or wincountry == thirdcountry== country or secondcountry == thirdcountry== country or wincountry ==secondcountry == thirdcountry== country: # if ???????????? # if score > winscore: # winscore = 0 # winscore += score # winnumber = 0 # winnumber += number # wincountry = 0 # wincountry += country # elif score > secondscore: # secondscore = 0 # secondscore += score # secondnumber = 0 # secondnumber += number # secondcountry = 0 # secondcountry += country # elif score > thirdscore: # thirdscore = 0 # thirdscore += score # thirdnumber = 0 # thirdnumber += number # thirdcountry = 0 # thirdcountry += country # # # # #Q 4751 # n = int(input()) # everything = [] # ALL VALUES OF ONE ROW = LIST, EVERYTHING = LIST OF THESE LISTS # for i in range(n): # onestudent = list(map(int, input().split())) # everything.append(onestudent) # # # country = [0] * 1000 # MAKING EMPTY SPACES TO COUNT OVERLAPPING COUNTRIES # # for x in range(2): # CALCULATES FIRST AND SECOND PLACES # biggest = 0 # BIGGEST SCORE CALCULATING VARIABLE # whereisfirst = 0 # ROW LOCATION OF FIRST AND SECOND PLACES # # everything: [0]: country, [1]: number, [2]: score # for i in range(len(everything)): # BECAUSE THE LENGTH OF EVERYTHING WILL KEEP CHANGING BY I # if biggest < everything[i][2]: # IF THE VALUE IS BIGGER THAN ORIGINAL BIGGEST # biggest = everything[i][2] # REPLACE IT (SAVING ON BIGGEST) # whereisfirst = i # SAVE WHICH ROW HAD WINNERS # # print(everything[whereisfirst][0], everything[whereisfirst][1]) # PRINTS THE WINNER'S (COUNTRY, STUDENT NUMBER) # country[ everything[whereisfirst][0] ] += 1 # IN THE 0000 COUNTRY EMPTY LIST, ADD 1 TO WINNER'S COUNTRY PLACE (ex. country 1 gets saved on the second space (0,1,2,3,~~~)) # everything.pop(whereisfirst) # DELETE THE ROW THAT HAD WINNERS IN EVERYTHING'S LIST # # if max(country) == 2: # IF THE MAX 2 OF COUNTRY 0000 LIST IS REACHED # loc = country.index(max(country)) # LOCATE THE EARLIEST (MAX(COUNTRY)) IN THE LIST / LOCATION IS A VARIABLE (ex. if 0 2 0 0 0 => loc = country 1) # for i in range(len(everything)): # TEST OUT EVERY LINE OF EVERYTHING # if everything[i][0] == loc: # IF THE 2+ COUNTRY NUMBER IS ON THE COUNTRY SEAT OF ANY LINE OF EVERYTHING: # everything[i][2] = 1 # CHANGE THE SCORE TO 1 SO IT WON'T BE ABLE TO COMPETE WITH OTHER SCORES ANYMORE # # thirdplacefind = 0 # therowofthird = 0 # for i in range(len(everything)): # CHECK EACH LINE OF EVERYTHING (length because it can change) # if thirdplacefind < everything[i][2]: # if the pre-existing third place score is smaller than the new score from another line: # thirdplacefind = everything[i][2] # save the new score over the pre-existing third place score # therowofthird = i # save the new third place's row # print(everything[therowofthird][0], everything[therowofthird][1]) # print the country and the student number # # # # # # # Q 4691 # money = 0 # winnermoney = 0 # n = int(input()) # for i in range(n): # rolled = list(map(int, input().split())) # rolled.sort() # if rolled[0] == rolled[1] == rolled[2] == rolled[3]: # money = 50000 + (rolled[0]*5000) # if money > winnermoney: # winnermoney = 0 # winnermoney += money # if rolled.count(1 or 2 or 3 or 4 or 5 or 6) == 3: # money = 10000 + # # # # # # # Q4776 - ????????????????????????????? # year = int(input()) # number = year % 10 # if year > 2014: # alphabet = (year - 2014) % 12 # elif year < 2014: # alphabet = (2014 - year) % 12 # else: # alphabet = 0 # if alphabet == 1: # alphabet = 'D' # elif alphabet == 2: # alphabet = 'E' # elif alphabet == 3: # alphabet = 'F' # elif alphabet == 4: # alphabet = 'G' # elif alphabet == 5: # alphabet = 'H' # elif alphabet == 6: # alphabet = 'I' # elif alphabet == 7: # alphabet = 'J' # elif alphabet == 8: # alphabet = 'K' # elif alphabet == 9: # alphabet = 'L' # elif alphabet == 10: # alphabet = 'A' # elif alphabet == 11: # alphabet = 'B' # elif alphabet == 12: # alphabet = 'C' # print(alphabet, number, sep='')
0
1
7
Hazel
2024년 3월 03일
In 소스 코드 제출
# homework # #Q 1420 # n = int(input()) # namelist=[] # numberlist=[] # orderednumbers=[] # # for i in range(1, n+1): # name, number = input().split() # name=str(name) # number = int(number) # namelist.append(name) # numberlist.append(number) # orderednumbers.append(number) # # orderednumbers.sort(reverse=True) # thirdnumber=numberlist.index(orderednumbers[2]) # thirdname=namelist[thirdnumber] # print(thirdname) # # Q1440 # n = int(input()) # allnumbers = list(map(int, input().split())) # # for i in range(n): # a = allnumbers[i] # print(i + 1, ": ", end='') # for j in range(n): # b = allnumbers[j] # if a > b: # print(">", end=' ') # elif a < b: # print("<", end=' ') # elif a == b: # print("=", end=' ') # print() # # daywork # # Q4011 first ver # firsthalf, secondhalf = list(input().split('-')) # not integer = counted as words list # year = firsthalf[0:2] # list[n:m] = list content from (n to m-1) # month = firsthalf[2:4] # day = firsthalf[4:6] # gender = secondhalf[0] # if gender == '1': # because list is words (not integer), use 'number' to find. # print("19", year, "/", month, "/", day, " M", sep='') # elif gender == '2': # print("19", year, "/", month, "/", day, " F", sep='') # elif gender == '3': # print("20", year, "/", month, "/", day, " M", sep='') # elif gender == '4': # print("20", year, "/", month, "/", day, " F", sep='') # # Q 4011 second ver (teacher-written, uses map and integer instead of treating as words list) # first, second = map(int, input().split('-')) # year = first // 10000 # month = first % 10000 // 100 # day = first % 100 # gender = second / 1000000 # if gender == 1: # print('19', year, '/') # # ''' # # x = 123456789 # # print(x//10) # # print(x%10) # # # # print(x//100) # # print(x%100) # ''' # # #Q 4016 # a, b, c = input().split() # a = int(a) # b = int(b) # c = int(c) # d = 0 # for i in range(1, 100001): # if (a % i == 0) and (b % i == 0) and (c % i == 0): # d = i # # print(d) # # # Q 4021 # numbers = list(map(int, input().split())) # z = 0 # for i in range(7): # if numbers[i]%2 == 1: # z += numbers[i] # if z != 0: # print(z) # else: # print('-1') # # # Q4026 # numbers = list(map(int, input().split())) # numbers.sort() # a = len(numbers) # if a%2 == 1: # print(numbers[a//2]) # else: # half = (numbers[(a//2)] - numbers[(a//2)-1]) // 2 # print((numbers[(a//2)-1]) + half) # # # Q 4711 # people = 0 # howMany = [] # for i in range(4): # off, on = map(int, input().split()) # people -= off # people += on # howMany.append(people) # howMany.sort() # print(howMany[3]) # # # Q 4716 # people = 0 # howMany = [] # for i in range(9): # off, on = map(int, input().split()) # people -= off # people += on # howMany.append(people) # howMany.sort() # print(howMany[8]) # # dish = list(input()) # height = 10 # for i in range(len(dish)-1): # if dish[i-1] == '(': # if dish[i] == '(': # height += 5 # elif dish[i] == ')': # height += 10 # elif dish[i-1] == ')': # if dish[i] == ')': # height += 5 # elif dish[i] == '(': # height += 10 # print(height) # print(height) # dish = list(input()) height = 10 for i in range(len(dish)-1): if dish[i] == '(': if dish[i+1] == '(': height += 5 elif dish[i+1] == ')': height += 10 elif dish[i] == ')': if dish[i+1] == ')': height += 5 elif dish[i+1] == '(': height += 10 print(height)
0
0
7
Hazel
2024년 2월 25일
In 소스 코드 제출
# range(n) = 0 to n-1 = total count is n because 0 counts as 1 # range(1, n+1) = 1 to n # #Q6092 # totalCalled = int(input()) #how many times were numbers called in total? # numbers = input().split() #what numbers were called? # for i in range(totalCalled): #for all between 1 to totalCalled -1: # numbers[i] = int(numbers[i]) #turn the num. of "numbers" into integers # calledCount = [] #a list from 1-23, shows how many times each number was called in the list "numbers" # for i in range(24): #from 0 to 23 (개수=24) # calledCount.append(0) #make a list of zeros (in total 23 zeros) # for i in range(totalCalled): #for all between 1 to totalCalled-1: # calledCount[numbers[i]] += 1 #add one to the number called count list (counting how many times each number was called) # for i in range(1, 24): #from 1 to 23: # print(calledCount[i], end=' ') #print each corresponding number in the number called count list, don't start a new line but use space inbetween. # #Q6093 # totalCalled = int(input()) # numbers = input().split() # # for i in range(totalCalled): # 0 ~ totalCalled-1 # numbers[i] = int(numbers[i]) # # for i in range(totalCalled-1, -1, -1): # (totalCalled-1), 0 (-1까지 = 0), (add "-1" each time) # print(numbers[i], end=' ') # #Q6094 # n = int(input()) # a = input().split() # for i in range(n): # a[i] = int(a[i]) # a.sort(reverse=True) # print(a[n-1]) # #Q1402: # totalNum = int(input()) # numbers = input().split() # # for i in range(totalNum): # numbers[i] = int(numbers[i]) # # numbers.sort(reverse=True) # # for i in range(totalNum): # print(numbers[i], end=' ') # # Q1403 # howMany = int(input()) # numbers = input().split() # for i in range(howMany): # numbers[i] = int(numbers[i]) # for i in range(howMany): # print(numbers[i]) # for i in range(howMany): # print(numbers[i]) # # Q1412 # sentence = input() # 문자라서 ".split() 필요없다!! # howMany = 0 # for i in range(ord('a'), ord('z')+1): # print(chr(i), ':', sentence.count(chr(i)), sep='') # Q1405 totalCount = int(input()) numbers = input().split() for i in range(totalCount): numbers[i] = int(numbers[i]) # just making integers for i in range(totalCount): # 5 rows for j in range(totalCount): # 5 columns print(numbers[j], end=' ') numbers.append(numbers[0]) numbers.pop(0) print()
0
0
8
Hazel
2024년 2월 18일
In 소스 코드 제출
'''' Array(other programs) = List(Python) * (LIST) size free * (LIST) lots of functions create a list by: name = [] -> can input data within [] (ex. name = [111, 343]) examples: used "data" as name for the list. n = data itself / o = order of data in the list append putting data into the list/ one at a time only sort data.sort() => sorts in order/ works on both alphabet, numbers count data.count(n) => how many of n is in the list? pop data.pop(o) == deletes last data/ deletes by list order = (1) is 2nd data extend data.extend(another list) => adds another list data into current list, no integers clear data.clear() => clears the list remove data.remove(n) => quite literally removes n from list/ not order-based but actual data-based index data.index(n) => searches for earliest n in the list/ data.index(n, o) => searches for n from m (for 중복 cases)/ data.index(n,o1,o2) => searches for n from m to o insert data.insert(o, n) => inserts n before data of o's order reverse data.sort(reverse=True) => sorts list but reverse order ''' data = [] print(data, type(data)) data.append(10) data.append(20) data.append(30) print(data, type(data)) data.pop() # default: last number of the list print(data, type(data)) data.pop(1) # number within parenthesis = list order. this case = 1st = 10 print(data, type(data)) data.append(10) data.append(50) data.append(30) print(data, type(data)) data.sort() print(data, type(data)) data.sort(reverse=True) print(data, type(data)) print(data.count(10)) more = [2007, 34343] examples = 3 data.extend(more) print(data, type(data)) data.remove(2007) print(data, type(data)) data.append(20) data.append(10) data.append(3034) data.insert(2, 100) print(data) print('index', data.index(10)) data.insert(0, 1301239) print(data)
0
2
28
Hazel
2024년 2월 18일
In 소스 코드 제출
# '''Q1677''' # m, n = input().split() # n = int(n) # m = int(m) # for j in range(1, n+1): # for i in range(1, m+1): # if (i == 1 and j == 1) or (i == m and j == n) or (i == m and j == 1) or (j == n and i == 1): # print('+', end='') # elif i == 1 and j != 1: # print('|', end='') # elif i == m and j != 1: # print('|', end='') # elif j == 1 or j == n: # print('-', end='') # else: # print(' ', end='') # print() '''Q1355''' # n = int(input()) # for i in range(n): # for j in range(i): # print(' ', end='') # for j in range(n-i): # print('*', end='') # print() # '''Q1357''' # n = int(input()) # for i in range(1, n+1): # for j in range(i): # print('*', end='') # print() # for i in range(n): # for j in range(n-i-1): # print('*', end='') # print() '''Q1358''' # n = int(input()) # m = n // 2 + 1 # for i in range(m): # # for in range 를 쓸때 더 적게 더 적게 뭔가가 필요하다면 전에 쓴 for 문의 i 를 갔다쓰면 됨 # # (ex. for j / k / l 다 보면 range 에 i가 들어감 = 새줄마다 range가 바뀜 - i가 계속 커짐) # for j in range(i, m-1): # # for RANGE(x 부터 y 전까지) = i부터 (m-1) 전까지 = i부터 m-2까지 #(0~1, 0~0, 나머지는 출력안함) # # i가 계속 바뀌면서 커지니까 i, m-1 을 하면 점점 범위가 줄어들음 = ' '가 더 적어짐 # print(' ', end='') # for k in range(i): # print('*', end='') # for l in range(i+1): # print('*', end='') # print()
0
0
9
Hazel
2024년 2월 18일
In 소스 코드 제출
전에 안올린 숙제 ''' Q 1282 제곱수 만들기 34: n i: 1 > 1 2 > 4 3 > 9 4 > 16 5 > 25 <<<<<< 이걸 써야됨 6 > 36 34보다 큼 ''' # a = int(input()) # if a == 2: # print(1, 1) # else: # for i in range(a): # if i * i >= a: # print(a - (i-1)*(i-1), i-1) # break # ''' i = range (n) 할때는 순서 (1번2번3번) range (n, m) 할때는 n, n+1, n+2, n+3 --- m-1 ''' # a, b = input().split() # a = int(a) # b = int(b) # s = 0 # if a % 2 == 0: # print('-', a, sep='', end='') # elif a % 2 == 1: # print(a, sep='', end='') # for i in range (a+1, b+1): # if i % 2 == 0: # s -= i # print('-', i, sep='', end='') # elif i % 2 == 1: # s += i # print ('+', i, sep='', end='') # if a % 2 == 0: # print('=', s-a, sep='') # if a % 2 == 1: # print('=', s+a, sep='') # '''ONEWAY Q1278''' # n = int(input()) # a = n // 10 # if a < 1: # print('1') # elif 10 > a >= 1: # print('2') # elif 100 > a >= 10: # print('3') # elif 1000 > a >= 100: # print('4') # elif 10000 > a >= 1000: # print('5') # elif 100000 > a >= 10000: # print('6') # elif 1000000 > a >= 100000: # print('7') # elif 10000000 > a >= 1000000: # print('8') # elif 100000000 > a >= 10000000: # print('9') # elif 1000000000 > a >= 100000000: # print('10') # '''ANOTHERWAY Q1278''' # n = int(input()) # s = 0 # for i in range(100): # n //= 10 # n = n // 10 # 12345 -> 1234 # s += 1 # s = s + 1 counting how many times # if n == 0: # break # print(s) # # ''' Q 1675 a = 'A' b = ord(a) b += 1 a = chr(b) print(a) >>> 'B' ''' # words = input() # for i in range(len(words)): # if words[i] == ' ': # print(' ',end='') # elif words[i] == 'a': # print('x', end='') # elif words[i] == 'b': # print('y', end='') # elif words[i] == 'c': # print('z', end='') # else: # b = ord(words[i]) # c = b - 3 # d = chr(c) # print(d, end='') # '''Q 1277''' # a = int(input()) # numbers = list(input().split()) # '''list()안넣어도 돼는데 보기편함''' # print(numbers[0], numbers[a//2], numbers[a-1]) # '''0부터가 첫번째!!''' N, K = input().split() N = int(N) K = int(K) time = 0 money = 0 for i in range(N): Wt, Wm, Bt, Bm = input().split() Wt = int(Wt) Wm = int(Wm) Bt = int(Bt) Bm = int(Bm) if (time + Wt <= K) and (time + Bt <= K): if Wt/Wm > Bt/Bm: time += Wt money += Wm elif Wt/Wm <= Bt/Bm: time += Bt money += Bm elif (time + Wt > K) and (time + Bt <= K): time += Bt money += Bm print(money) ''' test if works: 4 3000 1000 2000 300 700 1100 1900 400 900 900 1800 400 700 1200 2300 500 1200 '''
0
0
2
Hazel
2024년 2월 04일
In 소스 코드 제출
# ''' # Q4880 # "append" = put in set (can increase infinitely) # set [n][m] = (n,m) of the set matrix # remember that 0 = 1st one # # ex) set: # 500 200 200 100 # 800 370 300 120 # 700 250 300 90 # # set[0][0] => 500 (1st row 1st column) # set[2][1] => 250 (3rd row 2nd column) # ''' # N, K = input().split() # N = int(N) # K = int(K) # time = 0 # money = 0 # set = [] # for i in range(N): # Wt, Wm, Bt, Bm = input().split() # Wt = int(Wt) # Wm = int(Wm) # Bt = int(Bt) # Bm = int(Bm) # set.append([Wt, Wm, Bt, Bm]) # '''not this: (but leaving for future ref anyways)''' # if (time + Wt <= K) and (time + Bt <= K): # if Wt/Wm > Bt/Bm: # time += Wt # money += Wm # elif Wt/Wm <= Bt/Bm: # time += Bt # money += Bm # elif (time + Wt > K) and (time + Bt <= K): # time += Bt # money += Bm # # '''Q1279''' # a, b = input().split() # a = int(a) # b = int(b) # z = 0 # for i in range(a, b+1): # if i%2 == 0: # z -= i # elif i%2 == 1: # z += i # print(z) # # '''Q1280''' # a, b = input().split() # a = int(a) # b = int(b) # z = 0 # for i in range (a,b+1): # if i % 2 == 0: # z -= i # print('-', i, end='', sep='') # if i % 2 == 1: # z += i # print('+',i,end='',sep='') # print('=', z, sep='') # # '''Q1281''' # a, b = input().split() # a = int(a) # b = int(b) # z = 0 # if a % 2 == 0: # z -= a # print('-', a, end='', sep='') # elif a % 2 == 1: # z += a # print(a, end='', sep='') # for i in range(a+1, b+1): # if i % 2 == 0: # z -= i # print('-', i, end='', sep='') # if i % 2 == 1: # z += i # print('+', i, end='', sep='') # print('=', z, sep='') # ''' # 중첩 반복문 # n = int(input()) # # for i in range(n): # for j in range(n): # print('*(%d,%d)\t' %(i, j), end='') # print() # ''' # '''Q1352''' # n = int(input()) # for i in range(n): # for j in range (n): # print('*', end='') # print() # '''Q1356''' # n = int(input()) # z = ' ' # print('*'*n) # for i in range(n-2): # print('*', z*(n-2), '*', sep='') # print('*'*n) # '''Q1365''' # n = int(input()) # # for i in range(n): # 0,1,2,3,4 # for j in range(n): # if i == 0 or j == 0 or i == n-1 or j == n-1 or i == j or j == n-1-i: # print('*', end='') # else: # print(' ', end='') # print() # '''Q1366''' # n = int(input()) # m = n // 2 # for i in range(n): # for j in range(n): # if i == 0 or j == 0 or i == n-1 or j == n-1 or i == m or j == m or i == j or j == n-1 - i: # print('*', end='') # else: # print(' ', end='') # print() # '''Q1369''' # n, k = input().split() # n = int(n) # k = int(k) # for i in range(n): # for j in range(n): # if i == 0 or j == 0 or i == n-1 or j == n-1 or (i+j+1)%k == 0: # print('*', end='') # else: # print(' ', end='') # print() # (1, 1) / (1, 4) / (1, 7) # (2, 3) / (2, 6) # (3, 2) / (3, 5) / (3, 9) # (4, 1) / (4, 4) / (4, 7) # (5, 3) / (5, 6) # (6, 2) / (6, 5) / (6, 9) # (7, 1) / (7, 4) / (7, 7) # (8, 2) / (8, 6) # '''Q1353''' # # n = int(input()) # # for i in range(1, n+1): # # print('*'*i) # # '''Q1354''' # n = int(input()) # for i in range(1, n+1): # for j in range(1, n+1): # if n+1 - i < j: # print(' ', end='') # else: # print('*', end='') # print() # '''Q1355''' # n = int(input()) # for i in range(1, n+1): # for j in range(1, n+1): # if ji: # print(' ', end='') # else: # print('*', end='')
0
0
11
Hazel
2024년 2월 04일
In 소스 코드 제출
# a = int(input()) # x = 1 # for i in range(1, a+1): # x *= i # print(x) ''' a = int(input()) list = input().split() b = list[0] c = list[a//2] d = list[a-1] e = 0 f = 0 g = 0 if a == 1: print (list[0]) ask teacher Q for i in range(a): z = int(list[i]) if z == b: e == b if z == c: f == c if z == d: g == d print (e, f, g) ''' ''' n = int(input()) b = n // 10 if b < 1: print ('1') elif 10 > b >= 1: print ('2') elif 100 > b >= 10: print ('3') elif 1000 > b >= 100: print ('4') elif 10000 > b >= 1000: print ('5') elif 100000 > b >= 10000: print('6') elif 1000000 > b >= 100000: print('7') elif 10000000 > b >= 1000000: print('8') elif 100000000 > b >= 10000000: print('9') elif 1000000000 > b >= 100000000: print('10') ''' '''homework: (codeup side account) id hazelmazel1 pw Hazel1229:)''' ''' Q 1282 제곱수 만들기 34: n i: 1 > 1 2 > 4 3 > 9 4 > 16 5 > 25 <<<<<< 이걸 써야됨 6 > 36 34보다 큼 ''' # a = int(input()) # if a == 2: # print(1, 1) # else: # for i in range(a): # if i * i >= a: # print(a - (i-1)*(i-1), i-1) # break # ''' i = range (n) 할때는 순서 (1번2번3번) range (n, m) 할때는 n, n+1, n+2, n+3 --- m-1 ''' # a, b = input().split() # a = int(a) # b = int(b) # s = 0 # if a % 2 == 0: # print('-', a, sep='', end='') # elif a % 2 == 1: # print(a, sep='', end='') # for i in range (a+1, b+1): # if i % 2 == 0: # s -= i # print('-', i, sep='', end='') # elif i % 2 == 1: # s += i # print ('+', i, sep='', end='') # if a % 2 == 0: # print('=', s-a, sep='') # if a % 2 == 1: # print('=', s+a, sep='') # '''ONEWAY Q1278''' # n = int(input()) # a = n // 10 # if a < 1: # print('1') # elif 10 > a >= 1: # print('2') # elif 100 > a >= 10: # print('3') # elif 1000 > a >= 100: # print('4') # elif 10000 > a >= 1000: # print('5') # elif 100000 > a >= 10000: # print('6') # elif 1000000 > a >= 100000: # print('7') # elif 10000000 > a >= 1000000: # print('8') # elif 100000000 > a >= 10000000: # print('9') # elif 1000000000 > a >= 100000000: # print('10') # '''ANOTHERWAY Q1278''' # n = int(input()) # s = 0 # for i in range(100): # n //= 10 # n = n // 10 # 12345 -> 1234 # s += 1 # s = s + 1 counting how many times # if n == 0: # break # print(s) # # ''' Q 1675 a = 'A' b = ord(a) b += 1 a = chr(b) print(a) >>> 'B' ''' # words = input() # for i in range(len(words)): # if words[i] == ' ': # print(' ',end='') # elif words[i] == 'a': # print('x', end='') # elif words[i] == 'b': # print('y', end='') # elif words[i] == 'c': # print('z', end='') # else: # b = ord(words[i]) # c = b - 3 # d = chr(c) # print(d, end='') # '''Q 1277''' # a = int(input()) # numbers = list(input().split()) # '''list()안넣어도 돼는데 보기편함''' # print(numbers[0], numbers[a//2], numbers[a-1]) # '''0부터가 첫번째!!'''
0
0
4
Hazel
2024년 1월 16일
In 소스 코드 제출
# a=int(input()) # x=('*') # print(a*x) # # 문제집: question 1257 # # a, b = input().split() # a = int(a) # b = int(b) # c = a % 2 # d = b % 2 # # """remainders -> if 1, odd. if 0, even""" # e = b+1 # f = a+1 # g = 0 # if c == 1: # print (a, end=' ') # if d == 1: # # """ both are odd = print a then keep adding 2 then b """ # for i in range (a,b): # a += 1 # z = a % 2 # if z == 1: # print (a, end=' ') # if d == 0: # for i in range (a,b): # a += 1 # z = a % 2 # if z == 1: # print (a, end=' ') # if c == 0: # if d == 1: # for i in range (a,b): # a += 1 # z = a % 2 # if z == 1: # print (a, end=' ') # if d == 0: # for i in range (a,b): # a += 1 # z = a % 2 # if z == 1: # print (a, end=' ') # a = int(input()) # b = 0 # for i in range(1,a+1): # b += i # print (b) # a=int(input()) # c = 0 # for i in range (1,a+1): # b = i % 2 # if b == 0: # c += i # print (c) # a, b = input().split() # a = int(a) # b = int(b) # c = 0 # for i in range (a,b+1): # d = i % 3 # if d == 0: # c += i # print (c) # a = int(input()) # for i in range(1, 10): # print(a, '*', i, '=', a*i, sep='') # ''' # x = 10 값 # x = 'A' 이것도 값 # # x = [10, 20, 30] # list is written with [] # x[0] ~~> 10 0 in computers = 1st # x[1] ~~> 20 1 in computers = 2nd # # # 반복문: # # for i in range (범위) # # 범위 1개: 0 to N-1 # # 2개: N to M-1 # # 3개: N to M-1, Y마다 # ''' # # a = int(input()) # data = input().split() # # ex) data = ['3', '5', '7', '7', '2'] but written as words not numbers = need int # c = 0 # # for i in range(len(data)): # for all in range of the length of variable 'data': # """ can be written as 'for i in range(a) len means for the length of -> len(data)=5""" # x = int(data[i]) # turn into integers from all list in variable 'data' # c += x # continuously add the integers from list onto variable c # # print(c) # a = int(input()) # data = input().split() # z = 0 # for i in range(len(data)): # x = int(data[i]) # 아주 중요: i means 자릿값!!! not the actual value!! 1st value etc!! # if x % 5 == 0: # z += x # print(z) # a = int(input()) # data = input().split() # z = 0 # for i in range(len(data)): # x = int(data[i]) # if x % 2 == 1: # z += 1 # print (z) # a, b, c, n = input().split() # a = int(a) # b = int(b) # c = int(c) # n = int(n) # for i in range(n-1): # a = a * b + c # print(a) # n = int(input()) # x = 0 # for i in range(1, n+1): # if i % 10 == 1: # x += 1 # print(x) # a = int(input()) # data = input().split() # x = int(data[0]) # for i in range(a): # c = int(data[i]) # if c > x: # x = c # print(x) # 문제 1272 # """ ONE WAY """" # k, h = input().split() # k = int(k) # h = int(h) # if k == 1: # a = 1 # elif k % 2 == 0: # a = (k*10)/2 # elif k % 2 == 1: # a = (k + 1) / 2 # if h == 1: # b = 1 # elif h % 2 == 0: # b = (h*10)/2 # elif h % 2 == 1: # b = (h + 1) / 2 # print('%.0f' % (a+b)) # """ ANOTHER WAY """ # x, y = input().split() # x = int(x) # y = int(y) # a = 0 # if x % 2 == 0: # a = x * 5 # else: # a = (x//2) + 1 # """ ANOTHER ANOTHER WAY """ # ''' # 1 10 2 20 # 1 -> 10: (10x) # 10 -> 2: (5//) # 2 -> 20: (10x) # 20 -> 3: (6//) # 3 -> 30: (10x) # 30 -> 4: (7//) # ''' # p = 1 # q = 1 # x, y = input().split() # x = int(x) # y = int(y) # a = 5 # b = 5 # for i in range(x-1): # make range (x-1) because p is already 1 # if i % 2 == 0: # p *= 10 # else: # p //= a # a += 1 # for i in range(y-1): # make range (y-1) because q is already 1 # if i % 2 == 0: # q *= 10 # else: # q //= b # b += 1 # print(p+q) # n = int(input()) # for i in range(1, n + 1): # should be from 1 because x (dividing) cannot be 0 # x = i # if n % x == 0: # print(x, end=' ') # """ONE WAY!!!""" # n = int(input()) # a = 0 # for i in range(2, n): # if n % i == 0: # a += 1 # if n == 2: # print('prime') # elif a == 0: # print('prime') # else: # print('not prime') # # """ANOTHER WAY!!! more simple""" # n = int(input()) # a = 0 # for i in range(1, n+1): # if n % i == 0: # a += 1 # elif a == 2: # print('prime') # else: # print('not prime') # n, k = input().split() # n = int(n) # k = int(k) # if k == 0: # print ('1') # else: # print(n**k)
0
0
3
Hazel
2024년 1월 09일
In 소스 코드 제출
# a= input() # print(a[0:2], end=' ') # print(a[2:4], end=' ') # print(a[4:6], end=' ') # a,b,c = input().split(':') # a=int(a) # b=int(b) # c=int(c) # # if b==00: # print('00') # else: # print(b) # a, b = input().split(' ') # print(a,b,sep='') # a, b = input().split(' ') # a=int(a) # b=int(b) # c=a+b # print(c) # a=input() # b=input() # a=float(a) # b=float(b) # c=a+b # print(c) # c=int(input()) # a=chr(c) # print(a) # a=input() # a=float(a) # print(format(a,'.2f')) #a, b, c = input().split(' ') #a= int(a) #b=int(b) #c=int(c) #if (a>b>c): # print (b) #elif (a>c>b): # print (c) #elif (c>a>b): # print(a) #elif (c>b>a): # print (b) #elif (b>c>a): # print(c) #elif (b>a>c): # print(a) #elif (a==b) or (b==c): # print (b) #elif (a==c): # print (a) #a,b=input().split(' ') #a=int(a) #b=int(b) #c=a//10000 #d=1900+c #e=2000+c #if (b==1) or (b==2): # print (2012-d +1) #elif (b==3) or (b==4): # print (2012-e +1) #a=input() #a=int(a) #b=2012-a+1 #c=(b%100) #if b>=2000: # print (c, '3') #if b<2000: # print (c, '1') # a, b, c = input().split(' ') # a=int(a) # b=int(b) # c=int(c) # if (c>=10): # print(a,b,c, sep=('')) # elif (c<10): # print (a,b,'0',c, sep=('')) # a,b,c=input().split(' ') # a=int(a) # b=int(b) # c=int(c) # if (b<10): # if (c<10): # print (a, '0', b, '00', c, sep=('')) # elif (c<100): # print (a,'0', b, '0', c, sep=('')) # elif (c >= 100): # print (a, '0', b, c, sep=('')) # if (b>=10): # if (c<10): # print (a, b, '00', c, sep=('')) # elif (c<100): # print (a, b, '0', c, sep=('')) # elif (c >= 100): # print (a, b, c, sep=('')) # a,b,c=input().split(' ') # a=int(a) # b=int(b) # c=int(c) # if (a>b): # if (b>c): # print (c,b,a) # if (c>b): # if (a>c): # print (b,c,a) # elif (c>a): # print (b,a,c) # elif (b>a): # if (b>c): # if (a>c): # print (c,a,b) # elif (c>a): # print (a,c,b) # elif (c>b): # print (a,b,c) # if (a==b): # if (a>c): # print (c,a,b) # if (c>a): # print (a,b,c) # if (b==c): # if (b>a): # print (a,b,c) # if (a>b): # print (b,c,a) # if (c==a): # if (c>b): # print (b,a,c) # if (b>c): # print (c,a,b) # if (a==b==c): # print (a,b,c) # a,b=input().split(' ') # a=int(a) # b=int(b) # c=(b-30) # d=(a-1) # e=(b+60-30) # # if (b==0): # if (a==0): # print ('23 30') # else: # print (d, '30') # elif (c<0): # if (a==0): # print ('23', e) # else: # print (d, e) # else: # print (a, c) # a=input() # a=int(a) # ones=a%10 # tens=a//10 # d= ones * 10 # e = (d + tens) * 2 # f= e - 100 # if (e>=100): # print (f) # if (f <= 50): # print('GOOD') # elif (f > 50): # print('OH MY GOD') # else: # print (e) # if (e<=50): # print ('GOOD') # elif (e>50): # print ('OH MY GOD') # a=input() # a=int(a) # if (a>0): # print ('양수') # elif (a<0): # print ('음수') # else: # print ('0') # a=input() # a=int(a) # if (a<60): # print ('F') # elif (60<=a<70): # print ('D') # elif (70<= a < 80): # print ('C') # elif (80 <= a < 90): # print ('B') # elif (a>=90): # print ('A') # a=input() # a=int(a) # if (a<=10): # print ('정상') # elif (a<=20): # print ('과체중') # elif (a>20): # print ('비만') # a=input() # a=int(a) # b= a%10 # if (b==1): # if (a==11): # print ('11th') # else: # print (a, 'st', sep=('')) # elif (b==2): # if (a==12): # print ('12th') # else: print (a, 'nd', sep=('')) # elif (b==3): # if (a==13): # print ('13th') # else: # print (a, 'rd', sep=('')) # else: # print (a, 'th', sep=('')) # a,b=input().split(' ') # a=float(a) # b=float(b) # x=int(a) # y=int(b) # c=a+b # d=a-b # e=a*b # f=a/b # g=x^y # h=b-a # i=b/a # j=y^x # if (c>d) and (c>e) and (c>f) and (c>g) and (c>h) and (c>i) and (c>j): # print ('%.6f'%c) # elif (d>c) and (d>e) and (d>f) and (d>g)and (d>h) and (d>i) and (d>j): # print ('%.6f'%d) # elif (e>d) and (e>c) and (e>f) and (e>g) and (e>h) and (e>i) and (e>j): # print ('%.6f'%e) # elif (f>d) and (f>e) and (f>c) and (f>g) and (f>h) and (f>i) and (f>j): # print ('%.6f'%f) # elif (g>d) and (g>e) and (g>f) and (g>c) and (g>h) and (g>i) and (g>j): # print ('%.6f'%g) # elif (h>d) and (h>e) and (h>f) and (h>c) and (h>g) and (h>i) and (h>j): # print ('%.6f'%h) # elif (i>d) and (i>e) and (i>f) and (i>c) and (i>h) and (i>g) and (i>j): # print ('%.6f'%i) # elif (j > d) and (j > e) and (j > f) and (j > c) and (j > h) and (j > i) and (j > g): # print('%.6f' % j) # Question 1210 # a, b = input().split(' ') # a = int(a) # b = int(b) # # ''' # ONE WAY TO DO IT (x += y) means (x = x + y) # ''' # x = 0 # if a == 1: # x = x + 400 # elif a == 2: # x += 340 # elif a == 3: # x += 170 # elif a == 4: # x += 100 # elif a == 5: # x += 70 # y = 0 # if b == 1: # y += 400 # elif b == 2: # y += 340 # elif b == 3: # y += 170 # elif b == 4: # y += 100 # elif b == 5: # y += 70 # # z = x + y # if z > 500: # print('angry') # else: # print('no angry') # ''' # ANOTHER WAY TO DO IT # ''' # if a == 1: # if (b == 1) or (b==2) or (b==3): # print ('angry') # elif (b==4) or (b==5): # print ('no angry') # if a==2: # if (b==1) or (b==2) or (b==3): # print ('angry') # elif (b==4) or (b==5): # print ('no angry') # if a == 3: # if (b==1) or (b==2): # print ('angry') # elif (b==3) or (b==4) or (b==5): # print ('no angry') # if a==4: # print ('no angry') # if a==5: # print ('no angry') # a,b,c=input().split(' ') # a=int(a) # b=int(b) # c=int(c) # if (c>a) and (c>b): # if bool(c<a+b): # print ('yes') # else: # print ('no') # if (b>a) and (b>c): # if bool (b<a+c): # print ('yes') # else: # print ('no') # if (a>b) and (a>c): # if bool (a<b+c): # print ('yes') # else: # print ('no') # if (a==b) or (b==c) or (c==a) or (a==b==c): # print ('yes') # a, b = input().split(' ') # a = int(a) # b = int(b) # c = a % 400 # d = a % 4 # e = a % 100 # # if (b==1) or (b==3) or (b==5) or (b==7) or (b==8) or (b==10) or (b==12): # print ('31') # elif (b==4) or (b==6) or (b==9) or (b==11): # print ('30') # elif (b==2): # if c==0: # print ('29') # elif (d == 0) and (e != 0): # print ('29') # else: # print ('28') # ''' # 반복문: # for i in range (범위) # 범위 1개: 0 to N-1 # 2개: N to M-1 # 3개: N to M-1, Y마다 # # 3개에서는 뒤로갈수도 있다 (y is negative => 20,1, -1 = 20 to 2, -1마다) # ''' # # for i in range(1,101): # print (i, end=(' ')) # a=input() # a=int(a) # b = a + 1 # for i in range (1, b): # print (i, end=(' ')) # a, b = input().split(' ') # a = int(a) # b = int(b) # c = b + 1 # d = a + 1 # if b>a: # for i in range (a, c): # print (i, end=(' ')) # elif a>b: # for i in range (b, d): # print (i, end=(' ')) # elif a==b: # print (a) # ''' # ord: WORD TO NUMBER # chr: NUMBER TO WORD # ''' # a, b = input().split() # a=ord(a) # b=ord(b) # # for i in range (a, b+1): # print (chr(i), end=' ') # ''' # switched to BAEKJOON # ''' # # a = input() # a = int(a) # # for i in range (1, 10): # b = a * i # print (a, '*', i, '=', b) # i = int(input()) # 5 # for c in range(i): # 0 ~ 4 # a, b = map(int, input().split()) # c = a + b # print(c) # n = int(input()) # a=0 # for i in range(1, n+1): # a = a + i # print (a) # X=int(input()) # N=int(input()) # for i in range(N): # a, b = input().split() # a = int(a) # b = int(b) # X -= (a*b) # ''' # x -= y means x = x - y # ''' # if 0 == X: # print('Yes') # else: # print('No') # a=int(input()) # for i in range (0, a, 4): meaning every 4th time from 0 to the value 'a' # print('long', end=' ') # print('int') # v = int(input()) # for i in range(v): # a, b = input().split() # a = int(a) # b = int(b) # c = a + b # print(c) # T=input() # T=int(T) # for i in range(T): # a, b = input().split() # a=int(a) # b=int(b) # c = a + b # print ('Case #', i+1, ': ', c, sep='') # # T = input() # T = int(T) # for i in range(T): # a, b = input().split() # a=int(a) # b=int(b) # c= a + b # print('Case #', i+1, ': ', a, ' + ', b, ' = ', c, sep='') # N = int(input()) # for i in range(N): # a = '*' * (i+1) # ''' i는 0부터!!!! N은 괜찮음 ''' # print(a) # N = int(input()) # for i in range(N): # a = '*' * (i+1) # print (' ' * (N-(i+1)), a, sep='')
0
0
4
Hazel
2024년 1월 03일
In 소스 코드 제출
# print('hello :)', end=' ') # print('World') # # print('Hello', 'World', 'Apple', 's', sep=', ') # print ('Hello') # print ('Hello World') # print('Hello') # print('World') # print("'Hello'") # print('"Hello World"') # print('"!@#$%^&*()\'') # print('\"C:\\Download\\\'hello\'.py\"') # print('print(\"Hello\\nWorld\")') ''' 정수형 int -1, -2, -3, 0, 1, 2, 3 실수형 float -5.2, +3.2, 0.0 문자형 chr ASCII 문자열 str 부울형 bool True / False ''' # x = input() # y = input() # # print(x, y) # x, y = input().split() # x = int(x) # y = int(y) # # print(x, y) # print(x + y) # a=input() # print(a) # a=input() # n=int(a) # print(n) # a=input() # n=float(a) # print(n) # a=input() # b=input() # x=int(a) # y=int(b) # print(x) # print(y) # a,b=input().split(':') # print(a,b,sep=':') # y, m, d = input().split('.') # print(d, m, y, sep='-') # l,r = input().split('-') # print(l,r, sep='') # a=input() # b=input() # print(b) # print(a) # n=input() # n=int(n) # print(-n) # a=input() # n=ord(a) # print(chr(n+1)) # a,b=input().split(' ') # a=int(a) # b=int(b) # c=a-b # print(c) # a,b=input().split(' ') # a=float(a) # b=float(b) # m=a*b # print(m) # w,n=input().split( ) # n=int(n) # print(w*n) # n=input() # s=input() # n=int(n) # print(s*n) # a,b=input().split( ) # a=int(a) # b=int(b) # print(a**b) # a,b=input().split( ) # a=float(a) # b=float(b) # print(a**b) # # a,b=input().split( ) # a=int(a) # b=int(b) # print(a//b) # a,b=input().split( ) # a=int(a) # b=int(b) # print(a%b) # a,b=input().split( ) # a=float(a) # b=float(b) # print('%.3f' %(a/b)) # a,b=input().split( ) # a=int(a) # b=int(b) # c=a+b # d=a-b # e=a*b # f=a//b # g=a%b # h='%.2f'%(a/b) # print(c, d, e, f, g, sep='\n') # print(c) # print(d) # print(e) # print(f) # print(g) # print(h) # a,b,c=input().split( ) # a=int(a) # b=int(b) # c=int(c) # d=a+b+c # e='%.2f'%(d/3) # print(d, e) # f=input() # f=float(f) # print(f) # print(f) # print(f) # a,b=input().split( ) # a=int(a) # b=int(b) # print(a) # print(b) # a,b=input().split( ) # print(b,a) # a=input() # print(a,a,a) # w=input() # print(w[0]) # print(w[1]) # print(w[2]) # print(w[3]) # print(w[4]) # a,b=map(int, input().split( )) # print(a<b) # a,b=map(int, input().split( )) # print(a==b) # a,b=map(int,input().split( )) # print(b>=a) # a,b=map(int, input().split( )) # print(a!=b) # a=input() # a=int(a) # print(bool(a)) # a=input() # a=int(a) # print(bool(not a)) # a,b=input().split( ) # a=bool(int(a)) # b=bool(int(b)) # print(a and b) # a,b=input().split( ) # a=bool(int(a)) # b=bool(int(b)) # print(a or b) # a,b=input().split( ) # a=bool(int(a)) # b=bool(int(b)) # print((a and not b) or (not a and b)) # a,b=input().split( ) # a=bool(int(a)) # b=bool(int(b)) # print((a and b) or (not a and not b)) # a,b=input().split( ) # a=bool(int(a)) # b=bool(int(b)) # print(not a and not b) # a=(int(input())) # if bool(a<10): # print('small') # a=int(input()) # if bool(a<10): # print('small') # if bool (a>=10): # print ('big') # a,b= input().split( ) # a=(int(a)) # b=(int(b)) # if a>b: # print ('>') # if b>a: # print('<') # if b==a: # print('=') # a,b=input().split( ) # a=int(a) # b=int(b) # if a>b: # print (a-b) # if b>a: # print (b-a) # if a==b: # print ('0') # a=int(input()) # if a % 7 == 0: # print ('multiple') # else: # print ('not multiple') # a=int(input()) # if a % 2 == 0: # print('even') # else: # print('odd') # a=float(input()) # if 50 <= a <= 60: # print('win') # else: # print('lose') # a=int(input()) # if (30 <= a <= 40) or (60 <= a <= 70): # print('win') # else: # print('lose') # a=int(input()) # if (50 <= a <= 70): # print('win') # elif (a % 6 == 0): # print('win') # else: # print('lose') # a=int(input()) # if a % 2 == 1: # print('oh my god') # else: # print('enjoy') # a, b = input().split( ) # a=int(a) # b=int(b) # if (a % 2 == 1): # print('홀수+',end='') # else: # print('짝수+',end='') # if (b % 2 == 1): # print('홀수',end='') # else: # print('짝수',end='') # # if (a % 2 == 1) and (b % 2 == 1): # print('=짝수') # if (a % 2 == 0) and (b % 2 == 1): # print ('=홀수') # if (a % 2 == 1) and (b % 2 == 0): # print ('=홀수') # if (a % 2 == 0) and (b % 2 == 0): # print('=짝수') # a,b,c=input().split( ) # a=int(a) # b=int(b) # c=int(c) # d=(a-b+c) # if (d % 10 == 0): # print('대박') # else: # print('그럭저럭') # a,b,c = input().split( ) # a=int(a) # b=int(b) # c=int(c) # d=(a+b+c) # e=(d//100) # if e % 2 == 0: # print ('대박') # else: # print ('그럭저럭') # a, b, c = input().split( ) # a=int(a) # b=int(b) # c=int(c) # if (170 < a) and (170 < b) and (170 < c): # print('PASS') # else: # print('CRASH') a,b = input().split( ) a=int(a) b=int(b) c=(89-a)/5 c=int(c) if a==90: print(b) elif a<= 90: print(b + c + 1)
1
0
15

Hazel

더보기
bottom of page