답안 #892877

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
892877 2023-12-26T06:07:55 Z Sir_Ahmed_Imran Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
                              ///~~~LOTA~~~///
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define ll long long 
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define N 100001
void construct_network(int n,int m,int o){
    int p,q,r;
    vector<int> u,v;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            u.clear();
            for(int k=i;k<n;k++){
                if(k-i>o) continue;
                if(j+o-k+i<m)
                    u.append(k*m+j+o-k+i);
                if(j-o+k-i>=0 && k>i)
                    u.append(k*-j-o+k-i);
            }
            if(i==n-1 && j==m-1) continue;
            if(n*m<=10000)
                u.append(n,m);
            v.append(add_or(u));
        }
    }
    r=add_xor(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:29: error: no matching function for call to 'std::vector<int>::push_back(int&, int&)'
   28 |                 u.append(n,m);
      |                             ^
In file included from /usr/include/c++/10/vector:67,
                 from vision.h:5,
                 from vision.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note:   candidate expects 1 argument, 2 provided
vision.cpp:14:9: warning: unused variable 'p' [-Wunused-variable]
   14 |     int p,q,r;
      |         ^
vision.cpp:14:11: warning: unused variable 'q' [-Wunused-variable]
   14 |     int p,q,r;
      |           ^