# 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 완전제곱수
top of page
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
수정: 3월 31일
20240324
20240324
댓글 0개
좋아요
댓글(0)
bottom of page