Submission #623919
Source Code Expand
# -*- coding: utf-8 -*-
n = int(raw_input())
ws = map(int, raw_input().split())
cnt = 0
visited = [False] * n
while True:
cnt += 1
max_w = 0
s = ws.index(min(ws))
for i in xrange(s, n):
if visited[i] or ws[i] < max_w:
continue
visited[i] = True
max_w = max(max_w, ws[i])
ws[i] = 10 ** 6
if s > 0:
if not visited[0] and max_w < ws[0]:
visited[0] = True
ws[0] = 10 ** 6
if all(visited):
break
print cnt
Submission Info
| Submission Time | |
|---|---|
| Task | B - ディスコ社内ツアー |
| User | aosuka |
| Language | Python (2.7.3) |
| Score | 0 |
| Code Size | 543 Byte |
| Status | WA |
| Exec Time | 2044 ms |
| Memory | 12164 KiB |
Judge Result
| Set Name | Sample | Small | Permutation | All | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 20 | 0 / 10 | 0 / 70 | ||||||||||||||||||
| Status |
|
|
|
|
| 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 | 57 ms | 3380 KiB |
| 00_example_02.txt | AC | 57 ms | 3384 KiB |
| 00_example_03.txt | AC | 56 ms | 3376 KiB |
| 00_example_04.txt | AC | 57 ms | 3384 KiB |
| 10_rand_01.txt | WA | 57 ms | 3384 KiB |
| 10_rand_02.txt | WA | 57 ms | 3368 KiB |
| 10_rand_03.txt | WA | 58 ms | 3260 KiB |
| 10_rand_04.txt | AC | 57 ms | 3376 KiB |
| 10_rand_05.txt | AC | 56 ms | 3308 KiB |
| 10_rand_06.txt | WA | 57 ms | 3380 KiB |
| 10_rand_07.txt | WA | 56 ms | 3376 KiB |
| 10_rand_08.txt | WA | 56 ms | 3380 KiB |
| 20_perm_01.txt | WA | 57 ms | 3380 KiB |
| 20_perm_02.txt | WA | 58 ms | 3384 KiB |
| 20_perm_03.txt | WA | 56 ms | 3384 KiB |
| 20_perm_04.txt | WA | 57 ms | 3380 KiB |
| 20_perm_05.txt | WA | 57 ms | 3384 KiB |
| 20_perm_06.txt | WA | 56 ms | 3376 KiB |
| 20_perm_07.txt | WA | 57 ms | 3380 KiB |
| 20_perm_08.txt | WA | 56 ms | 3376 KiB |
| 30_hand_01.txt | AC | 54 ms | 3380 KiB |
| 30_hand_02.txt | AC | 56 ms | 3376 KiB |
| 30_hand_03.txt | AC | 58 ms | 3380 KiB |
| 30_hand_04.txt | AC | 58 ms | 3256 KiB |
| 30_hand_05.txt | WA | 55 ms | 3376 KiB |
| 30_hand_06.txt | WA | 55 ms | 3380 KiB |
| 50_rand_01.txt | TLE | 2036 ms | 5676 KiB |
| 50_rand_02.txt | TLE | 2036 ms | 7716 KiB |
| 50_rand_03.txt | TLE | 2034 ms | 7852 KiB |
| 50_rand_04.txt | TLE | 2035 ms | 6832 KiB |
| 50_rand_05.txt | WA | 1827 ms | 4804 KiB |
| 50_rand_06.txt | WA | 61 ms | 3380 KiB |
| 50_rand_07.txt | WA | 976 ms | 3872 KiB |
| 50_rand_08.txt | TLE | 2034 ms | 6772 KiB |
| 60_perm_01.txt | TLE | 2044 ms | 6440 KiB |
| 60_perm_02.txt | TLE | 2034 ms | 9192 KiB |
| 60_perm_03.txt | TLE | 2034 ms | 9384 KiB |
| 60_perm_04.txt | TLE | 2034 ms | 8068 KiB |
| 60_perm_05.txt | TLE | 2036 ms | 5168 KiB |
| 60_perm_06.txt | WA | 59 ms | 3376 KiB |
| 60_perm_07.txt | TLE | 2028 ms | 4264 KiB |
| 60_perm_08.txt | TLE | 2035 ms | 8192 KiB |
| 70_hand_01.txt | AC | 253 ms | 12152 KiB |
| 70_hand_02.txt | TLE | 2035 ms | 12164 KiB |
| 70_hand_03.txt | AC | 252 ms | 11312 KiB |
| 70_hand_04.txt | AC | 249 ms | 11184 KiB |
| 70_hand_05.txt | TLE | 2035 ms | 12028 KiB |
| 70_hand_06.txt | TLE | 2035 ms | 10680 KiB |