結果

問題 No.878 Range High-Element Query
ユーザー Schnee
提出日時 2019-10-30 19:43:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 542 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 24,204 KB
最終ジャッジ日時 2024-09-14 21:55:59
合計ジャッジ時間 9,228 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 1 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

class No878:
    def get_date(self):
        return list(map(int,input().split()))
    
    def count_highest(self,x):
        k = 1
        for i in range(1,len(x)):
            if x[i] > max(x[:i]):
                k += 1
        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