#include <bits/stdc++.h>
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int ll
typedef long long ll;
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
signed main()
{
FAST;
int n, a;
cin >> n >> a;
int arr[n+2];
arr[n + 1] = LLONG_MAX;
for(int i = 1; i <= n; i++) cin >> arr[i];
int q;
cin >> q;
while(q--) {
char t;
cin >> t;
if(t == 'F') {
int x;
cin >> x;
int cnt = 1;
if(a == x) cout << 0 << endl;
else {
int l = a - 1, r = a + 1;
bool flag = 1;
while(flag) {
cout << arr[l] << ' ' << arr[r] << endl;
if(l > 1 && arr[l] < arr[r]) l--;
else if(r <= n) r++;
else l--;
if(l < x && r > x) {
flag = 0;
break;
}
cnt++;
}
cout << cnt << endl;
}
}
else {
int x, y;
cin >> x >> y;
arr[x] += y;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
234 ms |
14464 KB |
Output isn't correct |
2 |
Incorrect |
156 ms |
9844 KB |
Output isn't correct |
3 |
Incorrect |
247 ms |
16040 KB |
Output isn't correct |
4 |
Incorrect |
370 ms |
33684 KB |
Output isn't correct |
5 |
Incorrect |
586 ms |
50560 KB |
Output isn't correct |
6 |
Incorrect |
196 ms |
13912 KB |
Output isn't correct |
7 |
Incorrect |
490 ms |
37400 KB |
Output isn't correct |
8 |
Incorrect |
804 ms |
88940 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2066 ms |
240064 KB |
Time limit exceeded |
2 |
Execution timed out |
2088 ms |
180636 KB |
Time limit exceeded |
3 |
Execution timed out |
2086 ms |
201444 KB |
Time limit exceeded |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Execution timed out |
2091 ms |
211908 KB |
Time limit exceeded |
6 |
Execution timed out |
2085 ms |
217980 KB |
Time limit exceeded |
7 |
Execution timed out |
2083 ms |
216328 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2086 ms |
158424 KB |
Time limit exceeded |
2 |
Execution timed out |
2086 ms |
181284 KB |
Time limit exceeded |
3 |
Execution timed out |
2081 ms |
226344 KB |
Time limit exceeded |
4 |
Execution timed out |
2041 ms |
233140 KB |
Time limit exceeded |
5 |
Execution timed out |
2079 ms |
156388 KB |
Time limit exceeded |
6 |
Execution timed out |
2083 ms |
214940 KB |
Time limit exceeded |
7 |
Execution timed out |
2076 ms |
207280 KB |
Time limit exceeded |
8 |
Execution timed out |
2085 ms |
185828 KB |
Time limit exceeded |
9 |
Execution timed out |
2081 ms |
247156 KB |
Time limit exceeded |
10 |
Execution timed out |
2088 ms |
155608 KB |
Time limit exceeded |
11 |
Execution timed out |
2090 ms |
223904 KB |
Time limit exceeded |
12 |
Execution timed out |
2045 ms |
224376 KB |
Time limit exceeded |
13 |
Execution timed out |
2025 ms |
210052 KB |
Time limit exceeded |