제출 #1115012

#제출 시각아이디문제언어결과실행 시간메모리
1115012AdamGSFire (JOI20_ho_t5)C++17
0 / 100
1062 ms1612 KiB
#include <bits/stdc++.h> using namespace std; vector<int> vec; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, q, t, l, r; cin >> n >> q; for(int i = 0; i < n; i++){ cin >> t; vec.push_back(t); } for(int i = 0; i < q; i++){ cin >> t >> l >> r; for(int j = n - 2; j >= 0; j--){ vec[j + 1] = max(vec[j + 1], vec[j]); } int sum = 0; for(int j = l - 1; j < r; j++){ sum += vec[j]; } cout << sum << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...