답안 #55982

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
55982 2018-07-09T09:05:06 Z 노영훈(#1562) Sushi (JOI16_sushi) C++11
5 / 100
12000 ms 2556 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MX=400010, inf=2e9;

int n, q;
int A[MX];

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    cin>>n>>q;
    for(int i=1; i<=n; i++) cin>>A[i];
    for(int i=1; i<=q; i++){
        int s, t, x; cin>>s>>t>>x;
        for(int jj=s; jj<=t+n; jj++){
            int j=(jj-1)%n+1;
            if(x<A[j]) swap(x,A[j]);
            if(j==t) break;
        }
        cout<<x<<'\n';
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 376 KB Output is correct
2 Correct 12 ms 488 KB Output is correct
3 Correct 13 ms 576 KB Output is correct
4 Correct 13 ms 672 KB Output is correct
5 Correct 14 ms 672 KB Output is correct
6 Correct 14 ms 672 KB Output is correct
7 Correct 14 ms 672 KB Output is correct
8 Correct 15 ms 672 KB Output is correct
9 Correct 15 ms 672 KB Output is correct
10 Correct 16 ms 672 KB Output is correct
11 Correct 16 ms 672 KB Output is correct
12 Correct 14 ms 672 KB Output is correct
13 Correct 23 ms 672 KB Output is correct
14 Correct 26 ms 672 KB Output is correct
15 Correct 21 ms 672 KB Output is correct
16 Correct 4 ms 708 KB Output is correct
17 Correct 2 ms 708 KB Output is correct
18 Correct 2 ms 708 KB Output is correct
19 Correct 2 ms 708 KB Output is correct
20 Correct 3 ms 708 KB Output is correct
21 Correct 2 ms 708 KB Output is correct
22 Correct 2 ms 708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 12035 ms 2556 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 376 KB Output is correct
2 Correct 12 ms 488 KB Output is correct
3 Correct 13 ms 576 KB Output is correct
4 Correct 13 ms 672 KB Output is correct
5 Correct 14 ms 672 KB Output is correct
6 Correct 14 ms 672 KB Output is correct
7 Correct 14 ms 672 KB Output is correct
8 Correct 15 ms 672 KB Output is correct
9 Correct 15 ms 672 KB Output is correct
10 Correct 16 ms 672 KB Output is correct
11 Correct 16 ms 672 KB Output is correct
12 Correct 14 ms 672 KB Output is correct
13 Correct 23 ms 672 KB Output is correct
14 Correct 26 ms 672 KB Output is correct
15 Correct 21 ms 672 KB Output is correct
16 Correct 4 ms 708 KB Output is correct
17 Correct 2 ms 708 KB Output is correct
18 Correct 2 ms 708 KB Output is correct
19 Correct 2 ms 708 KB Output is correct
20 Correct 3 ms 708 KB Output is correct
21 Correct 2 ms 708 KB Output is correct
22 Correct 2 ms 708 KB Output is correct
23 Execution timed out 12035 ms 2556 KB Time limit exceeded
24 Halted 0 ms 0 KB -