Submission #565162

# Submission time Handle Problem Language Result Execution time Memory
565162 2022-05-20T11:09:45 Z katwamiaw Saveit (IOI10_saveit) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
#define ll long long
#define no cout << "NO\n"
#define yes cout << "YES\n"
#define endl '\n'
#define pb push_back
using namespace std ;
//fflush(stdout) ;

const int MAX_N=1e3+5 ;
vector<int>v[MAX_N] ;
int des[1004][1004] ;

void dfs(int x, int p , int s){
    for(int i:v[x]){
        if(i!=p&&(des[s][i]==-1||des[s][i]>(des[s][x]+1))){
            des[s][i]=(des[s][x]+1) ;
            dfs(i,x,s) ;
        }
    }
}

void encode(int nv, int nh, int ne, int *v1, int *v2){
  encode_bit(1);
  encode_bit(0);
  for(int i=0 ; i<ne ; i++){
      v[v1[i]].push_back(v2[i]) ;
      v[v2[i]].push_back(v1[i]) ;
  }
  for(int i=0 ; i<nv ; i++){
      for(int j=0 ; j<nv ; j++){
          des[i][j]=-1 ;
          if(i==j) des[i][j]=0 ;
      }
      dfs(i,0,i) ;
  }
  for(int i=0 ; i<nv ; i++){
      for(int j=0 ; j<nh ; j++){
          while(des[i][j]--){
               encode_bit(1) ;
          }
           encode_bit(0);
      }
  }
}
#include "grader.h"
#include "decoder.h"
#include<bits/stdc++.h>
#define ll long long
#define no cout << "NO\n"
#define yes cout << "YES\n"
#define endl '\n'
#define pb push_back
using namespace std ;
//fflush(stdout) ;


void decode(int nv, int nh) {
   for(int i=0 ; i<nv ; i++){
       for(int j=0 ; j<nh ; j++){
           int x , r=0 ;
           x=decode_bit() ;
           while(x==1){
                r++ ;
                x=decode_bit()
           }
            hops(j,i,r);
       }
   }
}

Compilation message

decoder.cpp: In function 'void decode(int, int)':
decoder.cpp:20:31: error: expected ';' before '}' token
   20 |                 x=decode_bit()
      |                               ^
      |                               ;
   21 |            }
      |            ~