# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
913541 | daoquanglinh2007 | Hyper-minimum (IZhO11_hyper) | C++17 | 45 ms | 10872 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;
const int NM = 20;
int N, M, a[NM+5][NM+5][NM+5][NM+5];
int f1[NM+5][NM+5][NM+5][NM+5], f2[NM+5][NM+5][NM+5][NM+5], f3[NM+5][NM+5][NM+5][NM+5], f4[NM+5][NM+5][NM+5][NM+5];
deque <int> dq;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N >> M;
for (int i = 1; i <= N; i++)
for (int j = 1; j <= N; j++)
for (int k = 1; k <= N; k++)
for (int l = 1; l <= N; l++)
cin >> a[i][j][k][l];
for (int i = 1; i <= N; i++)
for (int j = 1; j <= N; j++)
for (int k = 1; k <= N; k++){
dq.clear();
for (int l = 1; l <= N; l++){
if (l > M && dq.front() == l-M) dq.pop_front();
while (!dq.empty() && a[i][j][k][l] <= a[i][j][k][dq.back()]) dq.pop_back();
dq.push_back(l);
if (l >= M) f1[i][j][k][l] = a[i][j][k][dq.front()];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |