結果

問題 No.878 Range High-Element Query
ユーザー SchneeSchnee
提出日時 2019-10-30 19:51:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 562 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 21,952 KB
最終ジャッジ日時 2023-10-12 23:52:22
合計ジャッジ時間 4,463 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,288 KB
testcase_01 AC 23 ms
7,880 KB
testcase_02 AC 26 ms
8,212 KB
testcase_03 AC 19 ms
7,824 KB
testcase_04 AC 24 ms
7,808 KB
testcase_05 AC 27 ms
7,756 KB
testcase_06 AC 18 ms
7,840 KB
testcase_07 AC 17 ms
7,936 KB
testcase_08 AC 29 ms
7,728 KB
testcase_09 AC 29 ms
7,812 KB
testcase_10 AC 20 ms
7,808 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

class No878:
    def get_date(self):
        return list(map(int,input().split()))
    
    def count_highest(self,x):
        k, t = 0, 0
        for i in range(len(x)):
            if x[i] > t:
                k += 1
                t = x[i]
        print(k)
    
    def solve(self):
        n, q = self.get_date()
        a = self.get_date()
        for _ in range(q):
            query = self.get_date()
            l, r = query[1:]
            b = a[l - 1: r]
            self.count_highest(b)


if __name__ == "__main__":
    pro = No878()
    pro.solve()
0