summaryrefslogtreecommitdiff
path: root/2011/qual/d/d.py
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2011-05-07 16:40:42 +0300
committerYuval Adam <yuv.adm@gmail.com>2011-05-07 16:40:42 +0300
commit09869227fe2beb5b7dbb3dc01293c34d57f5fd67 (patch)
treea43eabd317ecb0266952ee9267cf44139fc4c502 /2011/qual/d/d.py
parent50df8b05566709fe306efa360e57976ac5720121 (diff)
moved m and p print
Diffstat (limited to '2011/qual/d/d.py')
-rw-r--r--2011/qual/d/d.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/2011/qual/d/d.py b/2011/qual/d/d.py
index b3055cf..329ae4a 100644
--- a/2011/qual/d/d.py
+++ b/2011/qual/d/d.py
@@ -9,13 +9,15 @@ for t in xrange(T):
print el
m = len([el[i] for i in range(len(el)) if el[i] != i+1 and el[el[i]-1] != i+1])
p = len([el[i] for i in range(len(el)) if el[i] != i+1 and el[el[i]-1] == i+1])
-
+
+ print m, p
+
if m > 0:
m -= 1
steps = p + (2 * m)
res = steps
- print m, p
+
s = "Case #%d: %s\n" % (t+1, res)
print s
o.write(s)