Submission #17719

# Submission time Handle Problem Language Result Execution time Memory
17719 2016-01-12T09:14:51 Z Erzhann Hyper-minimum (IZhO11_hyper) C++
30 / 100
705 ms 41080 KB
/*
  /\     /\
  | ).|.( |
  |  >-<  |
  =========
It's Adilkhan99 miaaaaaau      
*/
#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define endl "\n"
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define mp make_pair
#define f first
#define s second 
#define name ""
#define _ ios_base::sync_with_stdio(false);cin.tie(0);

using namespace std;
                                            
const int MaxN = int (2e5) + 256;
const int INF = int(1e9);  
const int mod = (int)(1e9) + 7;
int x[36][36][36][36], Q, n , m;
int y[36][36][36][36];
int mn1[36][36][36][36];
int mn2[36][36][36][36];
int mn3[36][36][36][36];
int mn4[36][36][36][36];

int main () { _
	cin >> n >> m;
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    cin >> x[i][i1][i2][i3];
    int N = m;
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    mn1[i][i1][i2][i3] = INT_MAX,
                    mn2[i][i1][i2][i3] = INT_MAX,
                    mn3[i][i1][i2][i3] = INT_MAX,
                    mn4[i][i1][i2][i3] = INT_MAX;
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    for(int j = 0; j < N; j++)
                        if(i3 + j <= n)mn1[i][i1][i2][i3] = min(x[i][i1][i2][i3 + j], mn1[i][i1][i2][i3]);
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    for(int j = 0; j < N; j++)
                        if(i2 + j <= n)mn2[i][i1][i2][i3] = min(mn1[i][i1][i2 + j][i3], mn2[i][i1][i2][i3]);
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    for(int j = 0; j < N; j++)
                        if(i1 + j <= n)mn3[i][i1][i2][i3] = min(mn2[i][i1 + j][i2][i3], mn3[i][i1][i2][i3]);

    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    for(int j = 0; j < N; j++)
                        if(i + j <= n)mn4[i][i1][i2][i3] = min(mn3[i + j][i1][i2][i3], mn4[i][i1][i2][i3]);
    for(int i = 1; i <= n; i++)
        for(int i1 = 1; i1 <= n; i1++)
            for(int i2 = 1; i2 <= n; i2++)
                for(int i3 = 1; i3 <= n; i3++)
                    if(i + N - 1 <= n && i1 + N  - 1<= n && i2 + N - 1 <= n && i3 + N - 1 <= n)
                        cout << mn4[i][i1][i2][i3] << " ";
return 0;
}                   									
# Verdict Execution time Memory Grader output
1 Correct 0 ms 41080 KB Output is correct
2 Correct 0 ms 41080 KB Output is correct
3 Correct 0 ms 41080 KB Output is correct
4 Runtime error 0 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
5 Runtime error 2 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
6 Runtime error 5 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
7 Runtime error 9 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
8 Correct 51 ms 41080 KB Output is correct
9 Runtime error 28 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
10 Runtime error 41 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
11 Runtime error 100 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
12 Runtime error 236 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
13 Correct 334 ms 41080 KB Output is correct
14 Runtime error 149 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
15 Runtime error 184 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
16 Runtime error 500 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
17 Runtime error 361 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
18 Runtime error 261 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
19 Runtime error 455 ms 41080 KB writev (syscall #20) was called by the program (disallowed syscall)
20 Correct 705 ms 41080 KB Output is correct