AtCoder Grand Contest 013

Submission #1388040

Source codeソースコード

import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))

ret = 0
i = 0
while i < len(a):
    j = i
    while j < n - 1 and a[j] <= a[j+1]:
        j += 1
    h = i
    while h < n - 1 and a[h] >= a[h+1]:
        h += 1
    i = max(h, j) + 1
    ret += 1

print(ret)

Submission

Task問題 A - Sorted Arrays
User nameユーザ名 はむこ
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 300
Source lengthソースコード長 311 Byte
File nameファイル名
Exec time実行時間 282 ms
Memory usageメモリ使用量 23124 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt
All 300 / 300 sample_01.txt,sample_02.txt,sample_03.txt,sample_01.txt,sample_02.txt,sample_03.txt,subtask_1_01.txt,subtask_1_02.txt,subtask_1_03.txt,subtask_1_04.txt,subtask_1_05.txt,subtask_1_06.txt,subtask_1_07.txt,subtask_1_08.txt,subtask_1_09.txt,subtask_1_10.txt,subtask_1_11.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 148 ms 12392 KB
sample_02.txt AC 147 ms 12392 KB
sample_03.txt AC 150 ms 12392 KB
subtask_1_01.txt AC 216 ms 18700 KB
subtask_1_02.txt AC 190 ms 17224 KB
subtask_1_03.txt AC 172 ms 15288 KB
subtask_1_04.txt AC 282 ms 23012 KB
subtask_1_05.txt AC 231 ms 23060 KB
subtask_1_06.txt AC 264 ms 23124 KB
subtask_1_07.txt AC 278 ms 23100 KB
subtask_1_08.txt AC 224 ms 23008 KB
subtask_1_09.txt AC 263 ms 23020 KB
subtask_1_10.txt AC 148 ms 12392 KB
subtask_1_11.txt AC 148 ms 12392 KB