Submission #962193

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

*/

#include"wombats.h"
#include <set>
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include <cstdio>

#define maxn 5005
#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;
}*/

typedef pair <long long, int> pli;

int d[maxn];
int c, r;
int h[maxn][maxn];
int v[maxn][maxn];
int dp[maxn][maxn];


void dijkstra(int node)
{
    for(int i = 0; i < c; i++)
        d[i] = 1e9;
    d[node] = 0;

    for(int j = 0; j < r; j++)
    {
        set <int> q;
        for(int i = 0; i < c; i++)
            if(d[i] != 1e9)
                q.insert(i);

        while(!q.size())
        {
            int e = *q.begin();
            q.erase(q.begin());

            if(e + 1 < c)
                if(d[e + 1] > d[e] + h[j][e])
                    q.insert(e + 1);

            if(e >= 1)
                if(d[e - 1] > d[e] + h[j][e - 1])
                    q.insert(e - 1);
        }

        if(j + 1 < r)
            for(int i = 0; i < c; i++)
                d[i] += v[i][j];

    }

    for(int i = 0; i < c; i++)
        dp[node][i] = d[i];
}



void init(int R, int C, int H[5000][5000], int V[5000][5000])
{
    r = R;
    c = C;

    for(int i = 0; i < r; i++)
        for(int j = 0; j < c; j++)
        {
            if(j + 1 < c)
                h[i][j] = H[i][j];

            if(i + 1 < r)
                v[i][j] = V[i][j];
        }

    for(int i = 0; i < c; i++)
        dijkstra(i);
}



void changeH(int P , int Q , int W)
{
    h[P][Q] = W;
    for(int i = 0; i < c; i++)
        dijkstra(i);
}

void changeV(int P , int Q , int W)
{
    v[P][Q] = W;
    for(int i = 0; i < c; i++)
        dijkstra(i);
}


int escape(int V1 , int V2)
{
    return dp[V1][V2];
}


/**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;
      |      ^~~
/usr/bin/ld: /tmp/cc0UXjpy.o: in function `main':
grader.c:(.text.startup+0x129): undefined reference to `init'
collect2: error: ld returned 1 exit status