이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 99999999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
ll n=N,m=M;
vector<ll>t;
for(int i=0;i<m;i++)
t.pb(T[i]);
for(int i=0;i<n-2*m;i++)
t.pb(0);
sort(all(t));
return max(((t.size()>=2)?t[t.size()-1] + t[t.size()-2] + L : 0),((t.size()>=3)? t[t.size()-2] + t[t.size()-3] + 2*L:0));
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |