파이썬은 사기다.
https://www.acmicpc.net/problem/1357
a,b = raw_input().split() print int(str(int(a[::-1])+int(b[::-1]))[::-1])
https://www.acmicpc.net/problem/1252
a,b = map(lambda x:int(x,2),raw_input().split()) print bin(a+b)[2:]
https://www.acmicpc.net/problem/1212
print bin(int(raw_input(),8))[2:]
# -*- encoding: cp949 -*- word = [raw_input() for i in range(int(raw_input()))] count = 0 for i in range(len(word)): w_list = []; flag = True for j in range(len(word[i])-1): if word[i][j] != word[i][j+1]: if word[i][j+1] not in w_list: w_list.append(word[i][j]) else: flag = False break if flag: count += 1 print count
https://www.acmicpc.net/problem/1316
book = [raw_input() for i in range(int(raw_input()))] book_dict = {} for i in range(len(book)): if book[i] not in book_dict: book_dict[book[i]] = 1 else: book_dict[book[i]] += 1 print sorted(book_dict.iteritems(), key=lambda x:(-x[1],x[0]))[0][0]
https://www.acmicpc.net/problem/1356
# -*- encoding: cp949 -*- def gob(gob_list): return reduce(lambda x, y: x*y, gob_list) n = raw_input() flag = True for i in range(1,len(n)): if gob(map(int,n[:i]))==gob(map(int,n[i:])): flag = False print 'YES' break if flag: print 'NO'
'algorithm > problem solving' 카테고리의 다른 글
acmicpc.net 2667(백트래킹), 1012(백트래킹) (0) | 2016.07.18 |
---|---|
acmicpc.net 1427, 1463번(DP), 1520번(DP) (0) | 2016.07.17 |
acmicpc.net 1297번 TV크기, 1251번 단어 나누기, 1252번(실패....) (0) | 2016.07.12 |
acmicpc.net 1233번 주사위, 1247번 부호 (0) | 2016.07.10 |
acmicpc.net 1292번 쉽게 푸는 문제, 1269번 대칭 차집합 (0) | 2016.07.10 |