2014年5月11日

hackerrank---Sets - Symmetric Difference

摘要: 题目链接集合操作附上代码:1 M = int(input())2 m = set(map(int, raw_input().strip().split()))3 N = int(input())4 n = set(map(int, raw_input().strip().split()))5 tmp... 阅读全文

posted @ 2014-05-11 17:17 Stomach_ache 阅读(149) 评论(0) 推荐(0)

hackerrank---Find a string

摘要: 题目链接在字符串a中查找字符串b出现的次数...貌似不可以用a.count()附上代码:1 a = raw_input().strip()2 b = raw_input().strip()3 cnt = 0;4 for i in xrange(len(a)):5 cnt += 1 if a.... 阅读全文

posted @ 2014-05-11 16:53 Stomach_ache 阅读(172) 评论(0) 推荐(0)

hackerrank---List Comprehensions

摘要: 题目链接刷刷Python基本功...列表解析附上代码:1 x = int(input())2 y = int(input())3 z = int(input())4 n = int(input())5 print [[i, j, k] for i in xrange(x+1) for j in xr... 阅读全文

posted @ 2014-05-11 16:29 Stomach_ache 阅读(199) 评论(0) 推荐(0)

导航