blob: ba91de5aebe5a591105c987960b448705f03fc26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
f = open('3.in', 'r')
o = open('3.out', 'w')
T = int(f.readline().strip())
for t in xrange(T):
_n = f.readline().strip()
el = map(int, f.readline().strip().split(' '))
res = len([el[i] for i in range(len(el)) if el[i] != i+1])
s = "Case #%d: %s\n" % (t+1, res)
#print s
o.write(s)
f.close()
o.close()
|