# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
261254 | Saboon | 치료 계획 (JOI20_treatment) | C++14 | 102 ms | 9400 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn = 2e5 + 10;
ll T[maxn], L[maxn], R[maxn], C[maxn], p[maxn], q[maxn], dp[maxn];
int main(){
ios_base::sync_with_stdio(false);
ll n, m;
cin >> n >> m;
for (ll i = 1; i <= m; i++)
cin >> T[i] >> L[i] >> R[i] >> C[i];
if (*max_element(T+1, T+m+1) == 1){
for (ll i = 1; i <= m; i++)
p[i] = i;
sort(p+1, p+m+1, [](ll a, ll b){ return R[a] < R[b]; });
vector<ll> S;
for (ll iit = 1; iit <= m; iit++){
ll i = p[iit];
if (L[i] == 1)
dp[i] = C[i];
else
dp[i] = -1;
if (S.empty()){
if (dp[i] != -1)
S.push_back(i);
continue;
}
ll lo = -1, hi = S.size();
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |