summaryrefslogtreecommitdiff
path: root/2010/1b/a/a.py
diff options
context:
space:
mode:
Diffstat (limited to '2010/1b/a/a.py')
-rw-r--r--2010/1b/a/a.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/2010/1b/a/a.py b/2010/1b/a/a.py
new file mode 100644
index 0000000..f012867
--- /dev/null
+++ b/2010/1b/a/a.py
@@ -0,0 +1,25 @@
+f = open('1.in', 'r')
+o = open('1.out', 'w')
+
+T = int(f.readline().strip())
+
+for t in xrange(T):
+ (N, M) = map(int, f.readline().strip().split(' '))
+ pe = [f.readline().strip() for _n in range(N)]
+ pc = [f.readline().strip() for _m in range(M)]
+
+ fs = {'' : {}}
+ for p in pe:
+ dirs = p.split('/')
+ cur = fs
+ for d in dirs:
+ try:
+ cur = cur[d]
+ except KeyError:
+ cur[d] = {}
+ cur = cur[d]
+
+ res = (pe, pc)
+ s = "Case #%d: %s\n" % (t+1, res)
+ print s
+ #o.write(s)