본문 바로가기

python-algorithm1422

[백준] 15701 1 2 3 4 5 6 7 8 import math n=int(input()) cnt=0 for i in range(1,int (math.sqrt(n))+1): if (n%i) ==0: if (n//i) == i:cnt+=1 else: cnt+=2 print(cnt) cs 2021. 1. 15.
[백준] 15596 1 2 def solve(a: list): return sum(a) cs 2021. 1. 15.
[백준] 15552 1 2 3 import sys for _ in range(int(input())): print(sum(list(map(int, sys.stdin.readline().split())))) cs 2021. 1. 15.
[백준] 15351 1 2 3 4 5 6 7 for _ in range(int(input())): cnt=0 a=(input()).replace(" ","") for i in a : cnt+=ord(i)-64 if cnt==100: print("PERFECT LIFE") else: print(cnt) cs 2021. 1. 15.
[백준] 14929 1 2 3 4 5 6 7 8 9 10 n=int(input()) tmp=list(map(int, input().split())) mysum=[] mysum.append(tmp[0]) ans=0 for i in range(1,n): mysum.append(mysum[i-1]+tmp[i]) for i in range(n): ans+=tmp[i]*(mysum[n-1]-mysum[i]) print(ans) cs 2021. 1. 15.
[백준] 14915 1 2 3 4 5 6 7 8 9 m, n=map(int, input().split()) ans='' overten='ABCDEF' if m==0: print(0); exit() while m!=0: if (m%n)>9: ans+=overten[(m%n)%10] else: ans+=str (m%n) m//=n print(ans[::-1]) cs 2021. 1. 15.
[백준] 14910 1 2 3 tmp=list(map(int,input().split())) if tmp == sorted(tmp) : print("Good") else: print("Bad") cs 2021. 1. 15.
[백준] 14724 1 2 3 4 5 6 7 8 n=input() dongari=['PROBRAIN','GROW','ARGOS','ADMIN','ANT','MOTION','SPG','COMON','ALMIGHTY'] dongarimax=[] for i in range(9): dongarimax.append (max( list(map(int, input().split())))) checkmax=max(dongarimax) for i in range(9): if checkmax ==dongarimax[i]: print (dongari[i]); break cs 2021. 1. 15.
[백준] 14710 1 2 3 a,b=(map(int,input().split())) if (a%30)*12 != b: print("X"); exit() else: print("O") cs 2021. 1. 15.
[백준] 14697 1 2 3 4 5 6 7 a,b,c,n=(map(int,input().split())) cnt=0 for i in range(51): for j in range(51): for k in range(51): if a*i + b*j +c*k ==n: cnt=1; break print(cnt) Colored by Color Scripter cs 2021. 1. 15.
[백준] 14659 1 2 3 4 5 6 7 8 9 10 n=int(input()) tmp=list(map(int, input().split())) cnt=0 for i in range(n): tmpcnt=0 for j in range(i+1,n): if tmp[i]>tmp[j] : tmpcnt+=1 else: break cnt=max(cnt,tmpcnt) print(cnt) cs pypy ㅠㅠ 2021. 1. 14.
[백준] 14624 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import math n=int(input()) if n%2==0 : print("I LOVE CBNU") else: cnt= math.ceil(n/2) print("*"*n) print(" "*(cnt-1),end='') print("*") for i in range(1,cnt): print(" "*(cnt-i-1),end='') print("*",end='') print(" " * (2*i-1), end='') print("*",end='') print() cs 별찍기 문제류랑 비슷합니다. 반복문에 대한 이해를 할 수 있는 문제입니다 ㅎ 2021. 1. 14.