답안 #875862

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875862 2023-11-20T16:16:29 Z Mr_Ph Weirdtree (RMI21_weirdtree) C++17
13 / 100
2000 ms 3796 KB
#include "weirdtree.h"
//#include "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
vector<int> arr;
void initialise(int N, int Q, int h[]) {
    for(int i=1;i<=N;i++)
        arr.push_back(h[i]);
}
void cut(int l, int r, int k) {
    while(k--)
    {
    int mx=-1e18,idx=0;
        for(int i=l-1;i<r;i++)
        if(arr[i]>mx)mx=arr[i],idx=i;
       // cout<<l<<" "<<r<<" "<<idx<<" "<<mx<<endl;
        if(mx<=0)continue;
        arr[idx]--;
    }
}
void magic(int i, int x) {
	arr[i-1]=x;
}
long long int inspect(int l, int r) {
    long long sum=0;
    for(int i=l-1;i<r;i++)sum+=arr[i];
	return sum;
}

Compilation message

weirdtree.cpp: In function 'void cut(int, int, int)':
weirdtree.cpp:13:12: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+18' to '-2147483648' [-Woverflow]
   13 |     int mx=-1e18,idx=0;
      |            ^~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 781 ms 3544 KB Output is correct
4 Correct 815 ms 3408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2049 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2049 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2078 ms 3796 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 781 ms 3544 KB Output is correct
4 Correct 815 ms 3408 KB Output is correct
5 Execution timed out 2049 ms 348 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 781 ms 3544 KB Output is correct
4 Correct 815 ms 3408 KB Output is correct
5 Execution timed out 2049 ms 348 KB Time limit exceeded
6 Halted 0 ms 0 KB -