# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
885746 | huutuan | Council (JOI23_council) | C++14 | 928 ms | 78876 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 int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define isz(x) ((int)(x).size())
#define sumof(x) accumulate(all(x), 0ll)
const int N=3e5+1, M=20;
int n, m, a[N][M], cnt[M], msk[N];
pair<int, int> f[1<<M];
int get_val(int idx, int val){
return val==-1?-1:__builtin_popcount(idx&(~msk[val]));
}
void optimize(int idx, int val){
int t1=get_val(idx, val);
int t2=get_val(idx, f[idx].first);
int t3=get_val(idx, f[idx].second);
if (t1>t2){
f[idx].second=f[idx].first;
f[idx].first=val;
}else if (t1>t3 && val!=f[idx].first){
f[idx].second=val;
}
}
# | 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... |