# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789214 | esomer | Council (JOI23_council) | C++17 | 1043 ms | 39344 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>
using namespace std;
#define endl '\n'
typedef long long ll;
struct Node{
int mx, mx2, f, s;
void upd(int val, int i){
if(i != f && i != s){
if(val > mx){
s = f;
mx2 = mx;
f = i;
mx = val;
}else if(val > mx2){
s = i;
mx2 = val;
}
}else if(i == f && i != s){
//The second maximum remains the same, I can only change the first maximum.
if(val > mx){
f = i;
mx = val;
}
}else if(i != f && i == s){
//I can either change the first maximum and set it to second maximum, or change directly the second maximum, so proceed as normal.
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |