Codeforces42 codeforces 50A - Domino piling 50A - Domino piling Problem - 50A - Codeforces codeforces.com 1 2 3 4 5 6 7 8 9 def sol(m, n): answer = (m * n) // 2 return answer if __name__ == '__main__': m, n = map(int, input().split()) print(sol(m, n)) Colored by Color Scripter cs 2023. 1. 25. codeforces 1772A - A+B? https://codeforces.com/problemset/problem/1772/A Problem - 1772A - Codeforces codeforces.com 1 2 3 4 5 6 if __name__ == '__main__': t = int(input()) for _ in range(t): s = input() print(eval(s)) cs 2023. 1. 25. codeforces 1760A - Medium Number https://codeforces.com/problemset/problem/1760/A Problem - 1760A - Codeforces codeforces.com 1 2 3 4 5 6 7 8 9 10 11 12 13 14 from statistics import median def sol(nums): answer = median(nums) return answer if __name__ == '__main__': n = int(input()) for _ in range(n): nums = list(map(int, input().split())) print(sol(nums)) Colored by Color Scripter cs 2023. 1. 25. codeforces 1742A - Sum https://codeforces.com/problemset/problem/1742/A Problem - 1742A - Codeforces codeforces.com 1 2 3 4 5 6 7 8 9 10 11 12 13 def sol(nums): if sum(nums) - max(nums) == max(nums): return 'YES' else: return 'NO' if __name__ == '__main__': n = int(input()) for _ in range(n): nums = list(map(int, input().split())) print(sol(nums)) Colored by Color Scripter cs 2023. 1. 25. codeforces 133A - HQ9+ https://codeforces.com/problemset/problem/133/A Problem - 133A - Codeforces codeforces.com 1 2 3 4 5 6 7 8 9 10 11 def sol(s): if 'H' in s or 'Q' in s or '9' in s: return 'YES' else: return 'NO' if __name__ == '__main__': s = input() print(sol(s)) Colored by Color Scripter cs 2023. 1. 25. codeforces 158A - Next Round https://codeforces.com/problemset/problem/158/A Problem - 158A - Codeforces codeforces.com 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 from bisect import bisect_right, bisect_left def sol(nums, n, k): nums.sort() if nums[-k] != 0: answer = (n - bisect_left(nums, nums[-k])) else: answer = n-nums.count(0) return answer if __name__ == '__main__': n, k = map(int, input().split()) nums = list(map(int, .. 2023. 1. 25. codeforces 1722A - Spell Check 1 2 3 4 5 6 7 8 9 10 11 from collections import Counter def sol(origin_name, target_name): if sorted(Counter(target_name).items())== sorted(Counter(origin_name).items()): print("YES") else: print("NO") n=int(input()) for i in range(n): str_len=int(input()) target_name=input() sol('Timur',target_name) Colored by Color Scripter cs 2022. 9. 6. codeforces 1722B - Colourblindness 1 2 3 4 5 6 7 8 9 10 11 def sol(str1, str2): str1=str1.replace('G','B') str2=str2.replace('G', 'B') if str1 == str2 : print("YES") else : print("NO") n=int(input()) for i in range(n): str_len=int(input()) sol(input(),input()) cs 2022. 9. 6. codeforces 1714C - Minimum Varied Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pythondef sol(n): start = 9 answer = '' while n > 0: if n >= start: n -= start answer += str(start) else: pass start -= 1 return(answer[::-1]) for i in range(int(input())): n = int(input()) print(sol(n)) cs 2022. 8. 18. codeforces 200B - Drinks 1 2 3 4 5 def sol(n,nums): return 100*sum(nums)/(n*100) n=int(input()) nums=list(map(int,input().split())) print(sol(n,nums)) cs 2022. 7. 20. codeforces 791A - Bear and Big Brother 1 2 3 4 5 6 7 8 9 def sol(a,b): cnt=0 while a 2022. 7. 12. codeforces 509A - Maximum in Table 1 2 3 4 5 6 7 8 9 10 11 12 13 def sol(n): nums = [[0] * 10]*10 for i in range(n-1): nums.append([1,0,0,0,0]) for i in range(n): for j in range(n): if i == 0 or j == 0 : nums[i][j]=1 else : nums[i][j]=nums[i-1][j]+nums[i][j-1] print(nums[n-1][n-1]) n=int(input()) sol(n) Colored by Color Scripter cs 2022. 6. 13. 이전 1 2 3 4 다음