python-algorithm1422 codeforces 1686A - Everything Everywhere All But One 1 2 3 4 5 6 7 8 9 10 def sol(nums): n=len(nums) return sum(nums)/n for _ in range(int(input())): num_length=int(input()) nums=list(map(int, input().split())) if sol(nums) in nums : print("YES") else : print("NO") cs 2022. 5. 30. 백준 24544 카카오뷰 큐레이팅 효용성 분석 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def sol(nums1,nums2): not_inview=0 entire=sum(nums1) for i in range(len(nums2)): if nums2[i]==0 : not_inview+=nums1[i] print(entire) print(not_inview) n=int(input()) nums1=list(map(int,input().split())) nums2=list(map(int,input().split())) sol(nums1,nums2) cs 2022. 5. 26. 백준 23813 회전 1 2 3 4 5 6 7 8 9 10 def sol(s): ans=0 for i in range(len(s)): ans+=int(s[1:]+s[0]) s=s[1:]+s[0] print(ans) s=str(input()) sol(s) cs 2022. 5. 26. 백준 24923 Canadians, eh? 1 2 3 4 5 6 7 8 def sol(s): if s.split()[-1]=='eh?': print("Canadian!") else : print("Imposter!") s=input() sol(s) cs 2022. 5. 26. 백준 24927 Is It Even? 1 2 3 4 5 6 7 8 9 10 11 12 import sys cnt=0 n,k=map(int,input().split()) for i in range(n): num=int(sys.stdin.readline()) while num%2==0: cnt+=1 num//=2 if cnt>=k : print(1) else: print(0) cs 2022. 5. 26. codeforces 978A - Remove Duplicates 1 2 3 4 5 6 7 8 9 10 def sol(n,nums): ans=[] for i in range(1,n+1): if nums[-i] not in ans: ans.append(nums[-i]) print(len(ans)) print(*ans[::-1]) n=int(input()) nums=list(map(int,input().split())) sol(n,nums) cs 2022. 5. 26. codeforces 1206A - Choose Two Numbers 1 2 3 4 5 6 7 8 9 10 11 12 13 def sol(nums1,nums2): for i in nums1: for j in nums2: if i+j not in nums1 and i+j not in nums2 : ans1,ans2=i,j print(ans1,ans2) n1=int(input()) nums1=list(map(int, input().split())) n2=int(input()) nums2=list(map(int, input().split())) sol(nums1,nums2) Colored by Color Scripter cs 2022. 5. 26. codeforces 118A - String Task 1 2 3 4 5 6 7 8 9 10 11 12 13 vowels=['a','e','i','o','u','y'] def sol(s): ans='' s=s.lower() for i in vowels: s=s.replace(i,'') for i in s: ans+='.' ans+=i return ans s=input() print(sol(s)) cs 2022. 5. 25. codeforces 1A - Theatre Square 1 2 3 4 5 from math import ceil def sol(n,m,a): return(ceil(n/a)* ceil(m/a)) n,m,a=map(int,input().split()) print(sol(n,m,a)) cs 2022. 5. 25. codeforces 231A - Team 1 2 3 4 5 6 7 8 9 10 11 def sol(nums): if sum(nums)>=2 : return 1 else : return 0 n=int(input()) cnt=0 for _ in range(n): nums=list(map(int,input().split())) cnt+=sol(nums) print(cnt) cs 2022. 5. 25. 백준 25191 치킨댄스를 추는 곰곰이를 본 임스 1 2 3 4 5 6 7 def sol(n,a,b): return min(n,a//2+b) n=int(input()) a,b = map(int, input().split()) print(sol(n,a,b)) cs 2022. 5. 25. 백준 24883 자동완성 1 2 3 4 5 6 def sol(s): if s=='N' or s=='n' : print('Naver D2') else : print('Naver Whale') sol(input()) cs 2022. 5. 25. 이전 1 ··· 41 42 43 44 45 46 47 ··· 119 다음