CODE FESTIVAL 2016 qual A

Submission #6876204

Source codeソースコード

#!/usr/bin/env python3
#CODE FESTIVAL 2016 A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
x = []
for i in range(n):
    if i+1 > a[i]:
        x.append((a[i],i+1))
    else:
        x.append((i+1,a[i]))
print(n-len(list(set(x))))

Submission

Task問題 B - 仲良しうさぎ / Friendly Rabbits
User nameユーザ名 nkn
Created time投稿日時
Language言語 PyPy3 (2.4.0)
Status状態 AC
Score得点 200
Source lengthソースコード長 655 Byte
File nameファイル名
Exec time実行時間 233 ms
Memory usageメモリ使用量 65884 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_00.txt,0_01.txt,0_02.txt
All 200 / 200 0_00.txt,0_01.txt,0_02.txt,1_00.txt,1_01.txt,1_02.txt,1_03.txt,1_04.txt,1_05.txt,1_06.txt,1_07.txt,1_08.txt,1_09.txt,1_10.txt,1_11.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0_00.txt AC 167 ms 38256 KB
0_01.txt AC 164 ms 38256 KB
0_02.txt AC 164 ms 38256 KB
1_00.txt AC 169 ms 38256 KB
1_01.txt AC 228 ms 61404 KB
1_02.txt AC 227 ms 65756 KB
1_03.txt AC 233 ms 65756 KB
1_04.txt AC 227 ms 65756 KB
1_05.txt AC 228 ms 65756 KB
1_06.txt AC 230 ms 65756 KB
1_07.txt AC 228 ms 65884 KB
1_08.txt AC 190 ms 46888 KB
1_09.txt AC 221 ms 56220 KB
1_10.txt AC 212 ms 53756 KB
1_11.txt AC 180 ms 41200 KB