답안 #604743

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
604743 2022-07-25T09:24:12 Z almothana05 Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include "bits/stdc++.h"
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:4:1: error: 'pair' does not name a type
    4 | pair<int ,int>cmp , comp;
      | ^~~~
vision.cpp:5:1: error: 'vector' does not name a type
    5 | vector<int>num , opt , erg;
      | ^~~~~~
vision.cpp:6:1: error: 'pair' does not name a type
    6 | pair<int , int> trnasf(int x){
      | ^~~~
vision.cpp:9:7: error: expected nested-name-specifier before 'namspace'
    9 | using namspace std;
      |       ^~~~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:15:3: error: 'cmp' was not declared in this scope; did you mean 'bcmp'?
   15 |   cmp = transf(i);
      |   ^~~
      |   bcmp
vision.cpp:15:9: error: 'transf' was not declared in this scope; did you mean 'truncf'?
   15 |   cmp = transf(i);
      |         ^~~~~~
      |         truncf
vision.cpp:17:4: error: 'comp' was not declared in this scope
   17 |    comp = transf(j);
      |    ^~~~
vision.cpp:19:5: error: 'opt' was not declared in this scope
   19 |     opt.push_back(j);
      |     ^~~
vision.cpp:22:6: error: 'opt' was not declared in this scope
   22 |   if(opt.size()){
      |      ^~~
vision.cpp:26:4: error: 'num' was not declared in this scope; did you mean 'enum'?
   26 |    num.push_back(pl);
      |    ^~~
      |    enum
vision.cpp:29:3: error: 'opt' was not declared in this scope
   29 |   opt.clear();
      |   ^~~
vision.cpp:31:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   31 |  add_or(num);
      |         ^~~
      |         enum