結果
| 問題 |
No.2170 Left Addition Machine
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 21:34:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 547 bytes |
| コンパイル時間 | 2,412 ms |
| コンパイル使用メモリ | 81,412 KB |
| 実行使用メモリ | 114,468 KB |
| 最終ジャッジ日時 | 2025-06-12 21:35:40 |
| 合計ジャッジ時間 | 10,192 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 65 |
ソースコード
import sys
MOD = 998244353
def main():
import sys
sys.setrecursionlimit(1 << 25)
n, q = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
for _ in range(q):
L, R = map(int, sys.stdin.readline().split())
B = A[L-1:R]
while len(B) > 1:
max_val = max(B)
idx = B.index(max_val)
for j in range(idx):
B[j] = (B[j] + B[idx]) % MOD
del B[idx]
print(B[0] % MOD)
if __name__ == "__main__":
main()
gew1fw