답안 #232660

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
232660 2020-05-17T19:06:13 Z crossing0ver 저장 (Saveit) (IOI10_saveit) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
using namespace std;
vector<int> adj[1005];
bool vis[1005];
int dis[1005];
void binary (int n) {
	for (int i = 0; i < 10; i++) 
		if ((1 << i) & n) encode_bit(1);
		else encode_bit(0);
}
void encode(int nv, int nh, int ne, int *v1, int *v2){
  for (int i = 0; i < ne; i++) {
  	adj[v1[i]].push_back(v2[i]);
  	adj[v2[i]].push_back(v1[i]);
  }
  for (int  s = 0; s < nh; s++) {
  	queue<int> q;
  	q.push(s);
  	vis[s] = 1;
  	while (!q.empty()) {
		  int v = q.front();
		  
		  for (auto i : adj[v]) {
		  	if (!vis[i]) {
		  		vis[i] = 1;
		  		dis[i] = dis[v] + 1; 
			  }
		  }
	  }
	  for (int i = 0; i < n; i++)
	  	binary();
	  
	  
	  
	  memset(vis,0,sizeof vis);
	  memset(dis,0,sizeof dis);
	  
  	
  	
  	
  }
  encode_bit(1);
  encode_bit(0);
  return;
}
#include<bits/stdc++.h>
#include "grader.h"
#include "decoder.h"
using namespace std;
void decode(int nv, int nh) {
	for (int s = 0; s < nh; s++) {
		int ans = 0;
		for (int f = 0; f < nv; f++) {
			int ans = 0;
		 for (int x = 0; x < 10; x++)
		 	if (decode_bit())
		 		ans |= (1 << x);
			hops(s,f,ans); 
		 	}
	}
}

Compilation message

encoder.cpp: In function 'void encode(int, int, int, int*, int*)':
encoder.cpp:32:24: error: 'n' was not declared in this scope
    for (int i = 0; i < n; i++)
                        ^
encoder.cpp:33:12: error: too few arguments to function 'void binary(int)'
     binary();
            ^
encoder.cpp:8:6: note: declared here
 void binary (int n) {
      ^~~~~~

decoder.cpp: In function 'void decode(int, int)':
decoder.cpp:10:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    for (int x = 0; x < 10; x++)
    ^~~
decoder.cpp:13:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    hops(s,f,ans); 
    ^~~~
decoder.cpp:7:7: warning: unused variable 'ans' [-Wunused-variable]
   int ans = 0;
       ^~~