Submission #952170

# Submission time Handle Problem Language Result Execution time Memory
952170 2024-03-23T08:23:40 Z vjudge1 Tropical Garden (IOI11_garden) C++14
Compilation error
0 ms 0 KB
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<iostream>
#include "garden.h"
#include "gardenlib.h"
//这是一道交互题
using namespace std;
int mmax[150007], sec[150007], dist[300007][2], head[300007], eid, c[2], st;
struct edge {
   
    int to, next;
}e[300007];
inline void insert(register int a, register int b) {
   
    e[++eid].to = b; e[eid].next = head[a]; head[a] = eid;
}
inline void dfs1(register int u) {
   
    //printf("%d\n", u);
    for(register int i = head[u]; i; i = e[i].next) {
   
        int v = e[i].to;
        if(dist[v][0] != 0x3f3f3f3f) {
   
            //if(v != st << 1) {cerr << "Abort\n"; exit(0);}
            c[0] = dist[u][0] + 1 - dist[v][0];
            continue;
        }
        dist[v][0] = dist[u][0] + 1;
        dfs1(v);
    }
}
inline void dfs2(register int u) {
   
    for(register int i = head[u]; i; i = e[i].next) {
   
        int v = e[i].to;
        if

Compilation message

garden.cpp: In function 'void dfs2(int)':
garden.cpp:40:9: error: expected '(' at end of input
   40 |         if
      |         ^~
      |         (
garden.cpp:40:9: error: expected '}' at end of input
   40 |         if
      |         ^~
garden.cpp:37:53: note: to match this '{'
   37 |     for(register int i = head[u]; i; i = e[i].next) {
      |                                                     ^
garden.cpp:39:13: warning: unused variable 'v' [-Wunused-variable]
   39 |         int v = e[i].to;
      |             ^
garden.cpp:40:9: error: expected '}' at end of input
   40 |         if
      |         ^~
garden.cpp:35:34: note: to match this '{'
   35 | inline void dfs2(register int u) {
      |                                  ^