답안 #489168

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
489168 2021-11-21T11:09:03 Z Wayne_Yan L-triominoes (CEOI21_ltriominoes) C++17
컴파일 오류
0 ms 0 KB
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;

typedef int64_t ll;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define pb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define F(n) Fi(i,n)
#define Fi(i,n) Fl(i,0,n)
#define Fl(i,l,n) for(int i=l;i<n;i++)
#define RF(n) RFi(i,n)
#define RFi(i,n) RFl(i,0,n)
#define RFl(i,l,n) for(int i=n-1;i>=l;i--)
#define all(v) begin(v),end(v)
#define siz(v) (ll(v.size()))
#define get_pos(v,x) (lower_bound(all(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define mem(v,x) memset(v,x,sizeof v)
#define ff first
#define ss second
#define mid ((l+r)>>1)
#define RAN(a,b) uniform_int_distribution<int> (a, b)(rng)

template <typename T> using max_heap = __gnu_pbds::priority_queue<T,less<T> >;
template <typename T> using min_heap = __gnu_pbds::priority_queue<T,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

vector<bool> g[8192][8192];

signed main(){
  
  int W,H,H;
  cin >> W >> H >> K;
  if(((W%3) * (H%3) - (K%3)  ) % 3) printf("NO");
  F(8192*8192) g[i/8192][i%8192] = rand()&1;


  return 0;
}

Compilation message

ltrominoes.cpp: In function 'int main()':
ltrominoes.cpp:36:11: error: redeclaration of 'int H'
   36 |   int W,H,H;
      |           ^
ltrominoes.cpp:36:9: note: 'int H' previously declared here
   36 |   int W,H,H;
      |         ^
ltrominoes.cpp:37:20: error: 'K' was not declared in this scope
   37 |   cin >> W >> H >> K;
      |                    ^
ltrominoes.cpp:39:43: error: no match for 'operator=' (operand types are 'std::vector<bool>' and 'int')
   39 |   F(8192*8192) g[i/8192][i%8192] = rand()&1;
      |                                           ^
In file included from /usr/include/c++/10/vector:68,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/extc++.h:32,
                 from ltrominoes.cpp:1:
/usr/include/c++/10/bits/stl_bvector.h:740:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  740 |       operator=(const vector& __x)
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_bvector.h:740:31: note:   no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
  740 |       operator=(const vector& __x)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_bvector.h:771:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  771 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_bvector.h:771:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
  771 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_bvector.h:796:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
  796 |       operator=(initializer_list<bool> __l)
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_bvector.h:796:40: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
  796 |       operator=(initializer_list<bool> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~