# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
596783 | 2022-07-15T04:47:35 Z | 반딧불(#8447) | Fish 2 (JOI22_fish2) | C++17 | 13 ms | 1152 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n, q; int arr[100002]; int main(){ scanf("%d", &n); for(int i=1; i<=n; i++) scanf("%d", &arr[i]); scanf("%d", &q); while(q--){ int t, l, r; scanf("%d %d %d", &t, &l, &r); if(t==1){ arr[l] = r; continue; } int ans = 0; for(int i=l; i<=r; i++){ int s = i, e = i; int score = arr[i]; while(1){ if(l<s && score >= arr[s-1]) score += arr[--s]; else if(e<r && score >= arr[e+1]) score += arr[++e]; else break; } if(s==l && e==r) ans++; } printf("%d\n", ans); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 308 KB | Output is correct |
5 | Incorrect | 2 ms | 312 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 308 KB | Output is correct |
2 | Incorrect | 13 ms | 1152 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 308 KB | Output is correct |
5 | Incorrect | 2 ms | 312 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 308 KB | Output is correct |
2 | Incorrect | 13 ms | 1152 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 308 KB | Output is correct |
2 | Incorrect | 13 ms | 1152 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 308 KB | Output is correct |
5 | Incorrect | 2 ms | 312 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |