# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
566963 | almothana05 | Just Long Neckties (JOI20_ho_t1) | C++14 | 1 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define mod 1000000007
#define inf 100000000000000000
using namespace std;
vector<int>num , cmp;
int suf[300001];
int main(){
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
int menge, numm , nummer;
cin >> menge;
for(int i = 0 ; i < menge + 1; i++){
cin >> numm;
cmp.push_back(numm);
}
for(int i = 0 ; i < menge ; i++){
cin >> numm;
num.push_back(numm);
}
sort(num.begin() , num.end());
sort(cmp.begin() , cmp.end());
for(int i = 0 ; i < menge + 1 ; i++){
int pl = 0 , erg = 0;
for(int j = 0 ; j < menge + 1; j++){
if(j == i){
continue;
}
erg = max(erg , max(0 , cmp[j] - num[pl]));
pl++;
}
Compilation message (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... |