Submission #962984

# Submission time Handle Problem Language Result Execution time Memory
962984 2024-04-14T10:30:40 Z Ice_man Wombats (IOI13_wombats) C++14
Compilation error
0 ms 0 KB
/**
 ____    ____    ____    __________________    ____    ____    ____
||I ||  ||c ||  ||e ||  ||                ||  ||M ||  ||a ||  ||n ||
||__||  ||__||  ||__||  ||________________||  ||__||  ||__||  ||__||
|/__\|  |/__\|  |/__\|  |/________________\|  |/__\|  |/__\|  |/__\|

*/

#include "game.h"
#include <map>
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <random>

#define maxn 5005
#define maxn2 205
#define maxr 20000005
#define maxn2 205
#define maxlog 20
#define INF 1000000010
#define LINF 1000000000000000005
#define endl '\n'
#define pb(x) push_back(x)
#define X first
#define Y second
#define control cerr<<"passed"<<endl;

#pragma GCC optimize("O3" , "Ofast" , "unroll-loops" , "fast-math")
#pragma GCC target("avx2")

using namespace std;

/**std::chrono::high_resolution_clock::time_point startT, currT;
constexpr double TIME_MULT = 1;

double timePassed()
{
    using namespace std::chrono;
    currT = high_resolution_clock::now();
    double time = duration_cast<duration<double>>(currT - startT).count();
    return time * TIME_MULT;
}*/


struct node
{
    int dp[maxn2][maxn2];
    
    node()
    {
        for(int i = 0; i < maxn2; i++)
            for(int j = 0; j < maxn2; j++)
                dp[i][j] = 0;
    }
    
    node(int _dp[maxn2][maxn2])
    {
        for(int i = 0; i < maxn2; i++)
            for(int j = 0; j < maxn2; j++)
                dp[i][j] = _dp[i][j];
    }
};


node tree[350];
int r , c;
int dp[maxn2][maxn][maxn];
int h[maxn][maxn2] , v[maxn][maxn2];

int dp2[2][maxn2];


void calc_row(int x)
{
    int r = x % 2;
    
    for(int i = 1; i < c; i++)
        dp2[r][i] = min(dp2[r][i] , dp2[r][i - 1] + h[x][i - 1]);
    
    for(int i = 1; i < c; i++)
        dp2[r][i] = min(dp2[r][i] , dp2[r][i + 1] + h[x][i]);
}


int sz; /// opravi sz na bloka


void calc_dp(int block)
{
    int l = block * sz;
    int qr = min(block * sz + sz - 1 , r - 1);
    
    
    for(int k = 0; k < c; k++)
    {
        for(int i = 0; i < c; i++)
            for(int j = 0; j < 2; j++)
                dp2[j][i] = 1e9;
        
        dp2[ql % 2][k] = 0;
        calc_row(ql);
        
        for(int i = ql + 1; i <= qr; i++)
        {
            for(int j = 0; j < c; j++)
                dp2[i % 2][j] = dp2[(i - 1) % 2][j] + v[i - 1][j];
            calc_row(i);
        }
        
        for(int i = 0; i < c; i++)
            dp[block][k][i] = dp2[qr % 2][i];
        
    }
    
}


void leaf(int x , int block)
{
    for(int i = 0; i < c; i++)
        for(int j = 0; j < c; j++)
            tree[x].dp[i][j] = dp[block][i][j];
}


void divide(int )
{
    
}


void _merge(int x , int y)
{
    for(int i = 0; i < c; i++)
        for(int j = 0; j < c; j++)
            tree[x].dp[i][j] = 1e9;
    
    for(int i = 0; i < c; i++)
        divide(x , y , i , 0 , c - 1 , 0 , c - 1);
            
}




void build(int node , int l , int r)
{
    if(l == r)
    {
        leaf(node , l);
        return;
    }
    
    
    int mid = (l + r) / 2;
    
    build(node * 2 , l , mid);
    build(node * 2 + 1 , mid + 1 , r);
    
    tree[node] = _merge(tree[node * 2] , tree[node * 2 + 1]);
}



void update(int node , int l , int r , int qp)
{
    if(l == r)
    {
        leaf(node , l);
        return;
    }
    
    int mid = (l + r) / 2;
    
    if(qp <= mid)
        update(node * 2 , l , mid , qp);
    else
        update(node * 2 + 1 , mid + 1 , r , qp);
    
    
    tree[node] = _merge(tree[node * 2] , tree[node * 2 + 1]);
}








/**int main()
{

    #ifdef ONLINE_JUDGE /// promeni
        freopen("input.in", "r", stdin);
        freopen("taxi.out", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    //startT = std::chrono::high_resolution_clock::now();





    return 0;
}*/

Compilation message

grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
   15 |  int res;
      |      ^~~
wombats.cpp:9:10: fatal error: game.h: No such file or directory
    9 | #include "game.h"
      |          ^~~~~~~~
compilation terminated.