Submission #279954

# Submission time Handle Problem Language Result Execution time Memory
279954 2020-08-22T12:21:29 Z shinjan Crocodile's Underground City (IOI11_crocodile) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <bits/stdc++.h>
#define maxN 100001
#define maxM 1000001
#include "crocodile.h"
using namespace std;
vector<pair<int,int>> drvo[maxN];
bool spec[maxN];
int mini[maxN];
int siguran[maxN];
void namesti(int n)
{
    for(int i=0;i<n;i++)
    {
        siguran[i]=-1;
        mini[i]=-1;
    }
}
void dfs(int v,int par)
{
    int cvor,w;
    for(pair<int,int> p:drvo[v])
    {
        cvor=p.first;
        w=p.second;
        if(cvor!=par)
        {
            if(spec[cvor])
            {
                if(mini[v]>=w || mini[v]==-1)
                {
                    siguran[v]=mini[v];
                    mini[v]=w;
                }
                else if(w<siguran[v] || siguran[v]==-1)
                {
                    siguran[v]=w;
                }
            }
            else{
                dfs(cvor,v);
                if(siguran[cvor]!=-1 && (siguran[cvor]+w<=mini[v] || mini[v]==-1))
                {
                    siguran[v]=mini[v];
                    mini[v]=siguran[cvor]+w;
                }
                else if(siguran[cvor]!=-1 && (siguran[cvor]+w<siguran[v] || siguran[v]==-1))
                {
                    siguran[v]=siguran[cvor]+w;
                }
            }
        }
    }
}
int travel_plan(int n,int m,int r[maxM][2],int l[maxM],int k,int p[maxN])
{
    for(int i=0;i<m;i++)
    {
        drvo[r[i][0]].push_back({r[i][1],l[i]});
        drvo[r[i][1]].push_back({r[i][0],l[i]});
    }
    for(int i=0;i<k;i++)
    {
        spec[p[i]]=1;
    }
    if(spec[0])
      return 0;
    dfs(0,-1);
    return siguran[0];
}

Compilation message

crocodile.cpp:66:2: error: stray '\302' in program
   66 |     if(spec[0])
      |  ^
crocodile.cpp:66:3: error: stray '\240' in program
   66 |     if(spec[0])
      |   ^
crocodile.cpp:66:5: error: stray '\302' in program
   66 |     if(spec[0])
      |     ^
crocodile.cpp:66:6: error: stray '\240' in program
   66 |     if(spec[0])
      |      ^
crocodile.cpp:67:2: error: stray '\302' in program
   67 |       return 0;
      |  ^
crocodile.cpp:67:3: error: stray '\240' in program
   67 |       return 0;
      |   ^
crocodile.cpp:67:5: error: stray '\302' in program
   67 |       return 0;
      |     ^
crocodile.cpp:67:6: error: stray '\240' in program
   67 |       return 0;
      |      ^
crocodile.cpp:67:8: error: stray '\302' in program
   67 |       return 0;
      |        ^
crocodile.cpp:67:9: error: stray '\240' in program
   67 |       return 0;
      |         ^
crocodile.cpp:68:2: error: stray '\302' in program
   68 |     dfs(0,-1);
      |  ^
crocodile.cpp:68:3: error: stray '\240' in program
   68 |     dfs(0,-1);
      |   ^
crocodile.cpp:68:5: error: stray '\302' in program
   68 |     dfs(0,-1);
      |     ^
crocodile.cpp:68:6: error: stray '\240' in program
   68 |     dfs(0,-1);
      |      ^