답안 #604744

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
604744 2022-07-25T09:24:56 Z almothana05 Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include "bits/stdc++.h"
using namespace std;
int row , col;
pair<int ,int>cmp , comp;
vector<int>num , opt , erg;
pair<int , int> trnasf(int x){
	return {x % col , x / col};
}
using namspace std;
void construct_network(int H, int W , int K) {
	row = H;
	col = W;
	int menge = row * col , pl = menge;
	for(int i = 0 ; i < menge ; i++){
		cmp = transf(i);
		for(int j = i + 1 ; j < menge ; j++){
			comp = transf(j);
			if(abs(cmp.first - comp.first) + abs(cmp.second - comp.second) == K){
				opt.push_back(j);
			}
		}
		if(opt.size()){
			add_or(opt);
			pl++;
			add_and({i , pl - 1});
			num.push_back(pl);
			pl++;
		}
		opt.clear();
	}
	add_or(num);
}

Compilation message

vision.cpp:10:7: error: expected nested-name-specifier before 'namspace'
   10 | using namspace std;
      |       ^~~~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:16:9: error: 'transf' was not declared in this scope; did you mean 'trnasf'?
   16 |   cmp = transf(i);
      |         ^~~~~~
      |         trnasf