답안 #411344

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
411344 2021-05-25T06:20:09 Z ismoilov Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
//#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
//#define int ll
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
#define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
#define fv(a, c) for(int (a) = (1); (a) <= (c); (a)++)
#define fz(a, c) for(int (a) = (0); (a) < (c); (a)++)
#define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--)
#define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--)
#define pb push_back
#define in insert
#define ss second
#define ff first
#define vi vector <int>
#define fa(a, v) for(auto (a) : (v))
#define mnel(a) *min_element(all(a))
#define mxel(a) *max_element(all(a))
#define si set<int>
#define sov(a) sort(all((a)))
void construct_network(int h, int w, int k) {
	vector<int> ss;
	set<pair<int, int>> s;
	fpp(i,1,h){
		fpp(j,1,w){
			int a = 0, b = k, x = i*w + j;
			while(b >= 0){
				int y = (a+i)*w + (b+j);
				if(a + i <= h && b + j <= w){
					s.in({x, y = (a+i)*w + (b+j)});
				}
				if(a + i <= h && b - j > 0){
					s.in({x, y = (a+i)*w + (b-j)});
				}
				if(a - i > 0 && b + j <= w){
					s.in({x, y = (a-i)*w + (b+j)});
				}
				if(a - i > 0 && b - j > 0){
					s.in({x, y = (a-i)*w + (b-j)});
				}
			}
		}
	}
	fa(it, s){
		add._and({it.ff, it.ss});
	}
	fpp(i,1,s.size()){
		ss.pb(h*w + i);
	}
	add_or(ss);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:33:2: note: in expansion of macro 'fpp'
   33 |  fpp(i,1,h){
      |  ^~~
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:34:3: note: in expansion of macro 'fpp'
   34 |   fpp(j,1,w){
      |   ^~~
vision.cpp:25:27: warning: unnecessary parentheses in declaration of 'it' [-Wparentheses]
   25 | #define fa(a, v) for(auto (a) : (v))
      |                           ^
vision.cpp:53:2: note: in expansion of macro 'fa'
   53 |  fa(it, s){
      |  ^~
vision.cpp:54:3: error: 'add' was not declared in this scope; did you mean 'fadd'?
   54 |   add._and({it.ff, it.ss});
      |   ^~~
      |   fadd
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:56:2: note: in expansion of macro 'fpp'
   56 |  fpp(i,1,s.size()){
      |  ^~~
vision.cpp:15:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::set<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                                       ~~~~^~~~~~
vision.cpp:56:2: note: in expansion of macro 'fpp'
   56 |  fpp(i,1,s.size()){
      |  ^~~
vision.cpp:59:2: error: 'add_or' was not declared in this scope
   59 |  add_or(ss);
      |  ^~~~~~