# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1027448 |
2024-07-19T06:32:51 Z |
변재우(#10954) |
Sushi (JOI16_sushi) |
C++17 |
|
16 ms |
2024 KB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int Nmax=100010;
int N, Q, A[Nmax];
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>N>>Q;
for(int i=1; i<=N; i++) cin>>A[i];
while(Q--) {
int a, b, x; cin>>a>>b>>x;
for(int i=a; ; i=i%N+1) {
if(A[i]>x) swap(A[i], x);
if(i==b) break;
}
cout<<x<<"\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
348 KB |
Output is correct |
2 |
Correct |
8 ms |
484 KB |
Output is correct |
3 |
Correct |
8 ms |
348 KB |
Output is correct |
4 |
Correct |
8 ms |
348 KB |
Output is correct |
5 |
Correct |
9 ms |
348 KB |
Output is correct |
6 |
Correct |
8 ms |
348 KB |
Output is correct |
7 |
Correct |
8 ms |
348 KB |
Output is correct |
8 |
Correct |
8 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
8 ms |
488 KB |
Output is correct |
11 |
Correct |
9 ms |
344 KB |
Output is correct |
12 |
Correct |
9 ms |
348 KB |
Output is correct |
13 |
Correct |
11 ms |
348 KB |
Output is correct |
14 |
Correct |
16 ms |
348 KB |
Output is correct |
15 |
Correct |
15 ms |
344 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
2024 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
348 KB |
Output is correct |
2 |
Correct |
8 ms |
484 KB |
Output is correct |
3 |
Correct |
8 ms |
348 KB |
Output is correct |
4 |
Correct |
8 ms |
348 KB |
Output is correct |
5 |
Correct |
9 ms |
348 KB |
Output is correct |
6 |
Correct |
8 ms |
348 KB |
Output is correct |
7 |
Correct |
8 ms |
348 KB |
Output is correct |
8 |
Correct |
8 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
8 ms |
488 KB |
Output is correct |
11 |
Correct |
9 ms |
344 KB |
Output is correct |
12 |
Correct |
9 ms |
348 KB |
Output is correct |
13 |
Correct |
11 ms |
348 KB |
Output is correct |
14 |
Correct |
16 ms |
348 KB |
Output is correct |
15 |
Correct |
15 ms |
344 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Runtime error |
7 ms |
2024 KB |
Execution killed with signal 11 |
24 |
Halted |
0 ms |
0 KB |
- |