Submission #1652645


Source Code Expand

N = input()
src = map(int, raw_input().split())
arr = [[] for i in range(10**5+2)]
for i,a in enumerate(src):
  arr[a].append(i)

pos = start = -1
round = 1
for ids in arr:
  if len(ids) == 0: continue
  if start < 0:
    start = pos = ids[0]
  for id in ids:
    if start < pos:
      if start < id < pos: round += 1
    elif pos < start:
      if id < pos or start < id: round += 1
    pos = id

print(round)

Submission Info

Submission Time
Task B - ディスコ社内ツアー
User prd_xxx
Language Python (2.7.6)
Score 0
Code Size 429 Byte
Status WA
Exec Time 155 ms
Memory 20712 KB

Judge Result

Set Name Sample Small Permutation All
Score / Max Score 0 / 0 0 / 20 0 / 10 0 / 70
Status
AC × 4
AC × 13
WA × 13
AC × 16
WA × 7
AC × 23
WA × 25
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt
Small 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt
Permutation 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt
All 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt, 50_rand_01.txt, 50_rand_02.txt, 50_rand_03.txt, 50_rand_04.txt, 50_rand_05.txt, 50_rand_06.txt, 50_rand_07.txt, 50_rand_08.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt, 70_hand_03.txt, 70_hand_04.txt, 70_hand_05.txt, 70_hand_06.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 42 ms 13708 KB
00_example_02.txt AC 43 ms 13708 KB
00_example_03.txt AC 42 ms 13708 KB
00_example_04.txt AC 44 ms 13708 KB
10_rand_01.txt WA 43 ms 13708 KB
10_rand_02.txt WA 43 ms 13708 KB
10_rand_03.txt WA 43 ms 13708 KB
10_rand_04.txt AC 42 ms 13708 KB
10_rand_05.txt WA 43 ms 13708 KB
10_rand_06.txt WA 43 ms 13708 KB
10_rand_07.txt WA 43 ms 13708 KB
10_rand_08.txt WA 43 ms 13708 KB
20_perm_01.txt AC 43 ms 13708 KB
20_perm_02.txt AC 43 ms 13708 KB
20_perm_03.txt WA 42 ms 13708 KB
20_perm_04.txt WA 42 ms 13708 KB
20_perm_05.txt AC 42 ms 13708 KB
20_perm_06.txt WA 43 ms 13708 KB
20_perm_07.txt WA 43 ms 13708 KB
20_perm_08.txt WA 42 ms 13708 KB
30_hand_01.txt AC 42 ms 13708 KB
30_hand_02.txt AC 43 ms 13708 KB
30_hand_03.txt AC 43 ms 13708 KB
30_hand_04.txt AC 43 ms 13708 KB
30_hand_05.txt AC 43 ms 13708 KB
30_hand_06.txt WA 42 ms 13708 KB
50_rand_01.txt WA 71 ms 14780 KB
50_rand_02.txt WA 100 ms 15928 KB
50_rand_03.txt WA 99 ms 15496 KB
50_rand_04.txt WA 91 ms 15692 KB
50_rand_05.txt WA 60 ms 14372 KB
50_rand_06.txt WA 43 ms 13708 KB
50_rand_07.txt WA 50 ms 14004 KB
50_rand_08.txt WA 90 ms 15648 KB
60_perm_01.txt AC 81 ms 15564 KB
60_perm_02.txt AC 116 ms 18188 KB
60_perm_03.txt WA 123 ms 18264 KB
60_perm_04.txt WA 100 ms 17116 KB
60_perm_05.txt AC 64 ms 14632 KB
60_perm_06.txt AC 42 ms 13708 KB
60_perm_07.txt AC 54 ms 14120 KB
60_perm_08.txt AC 101 ms 17192 KB
70_hand_01.txt AC 133 ms 20712 KB
70_hand_02.txt AC 134 ms 20712 KB
70_hand_03.txt AC 116 ms 17592 KB
70_hand_04.txt AC 111 ms 17592 KB
70_hand_05.txt WA 155 ms 19052 KB
70_hand_06.txt WA 119 ms 16488 KB