제출 #490353

#제출 시각아이디문제언어결과실행 시간메모리
490353mathking1021Languages (IOI10_languages)C++17
컴파일 에러
0 ms0 KiB
#include <stdlib.h> #include <stdio.h> #include <cmath> #include <unordered_set> #include "grader.h" #include "lang.h" #define SZ 100 using namespace std; typedef unsigned long long ll; const int M = 100; const int N = 2; const int K = 15; unordered_set<pair<ll, int>> x; unordered_set<pair<ll, int>> xxx; int y[65]; //int cnt = 0; void excerpt(int *E) { // int mx2 = -1, mi2 = 0; // for(int i = 0; i < 56; i++) y[i] = 0; // for(int i = 0; i < 100; i++) // { // int mx = -1, mi = 0, mx2 = -1; // for(int j = 0; j < 56; j++) // { // if(x[E[i]][j] > mx) mx = x[E[i]][j], mi = j; // else if(x[E[i]][j] > mx2) mx2 = x[E[i]][j]; // } // y[mi] += M + N * sqrt(mx - mx2) + K * sqrt(sqrt(mx - mx2)); // } // mx2 = -1; // for(int i = 0; i < 56; i++) // { // if(y[i] > mx2) mx2 = y[i], mi2 = i; // } int mx = -1, mi = -1; for(int i = 0; i < 56; i++) { int cnt = 0; for(int j = 0; j < 97; j++) { ll t = E[j] * 65536LL * 65536LL + E[j + 1] * 65536LL + E[j + 2]; ll t2 = E[j + 1] * 65536LL + E[j + 2]; cnt += x.count(t * 100 + i) + xxx.count(t2 * 100 + i); } if(mx < cnt) mx = cnt, mi = i; } int k = language(mi); for(int i = 0; i < 97; i++) { ll t = E[i] * 65536ULL * 65536ULL + E[i + 1] * 65536ULL + E[i + 2]; x.insert(t * 100 + i); ll t2 = E[i] * 65536LL + E[i + 1]; xxx.insert(t2 * 100 + i); } // cnt++; }

컴파일 시 표준 에러 (stderr) 메시지

lang.cpp:18:30: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >]'
   18 | unordered_set<pair<ll, int>> x;
      |                              ^
In file included from /usr/include/c++/10/unordered_set:47,
                 from lang.cpp:4:
/usr/include/c++/10/bits/unordered_set.h:135:7: note: 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >]' is implicitly deleted because the default definition would be ill-formed:
  135 |       unordered_set() = default;
      |       ^~~~~~~~~~~~~
/usr/include/c++/10/bits/unordered_set.h:135:7: error: use of deleted function 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<long long unsigned int, int> >; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>]'
In file included from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable.h:451:7: note: 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<long long unsigned int, int> >; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>]' is implicitly deleted because the default definition would be ill-formed:
  451 |       _Hashtable() = default;
      |       ^~~~~~~~~~
/usr/include/c++/10/bits/hashtable.h:451:7: error: use of deleted function 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<long long unsigned int, int> >; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]'
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: note: 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<long long unsigned int, int> >; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]' is implicitly deleted because the default definition would be ill-formed:
 1791 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: error: use of deleted function 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing]'
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: note: 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<long long unsigned int, int>; _Value = std::pair<long long unsigned int, int>; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<long long unsigned int, int> >; _H2 = std::__detail::_Mod_range_hashing]' is implicitly deleted because the default definition would be ill-formed:
 1368 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<long long unsigned int, int> >]'
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: note: 'std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<long long unsigned int, int> >]' is implicitly deleted because the default definition would be ill-formed:
 1112 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: error: use of deleted function 'std::hash<std::pair<long long unsigned int, int> >::hash()'
In file included from /usr/include/c++/10/unordered_set:45,
                 from lang.cpp:4:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<long long unsigned int, int> >::hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:101:12: error: no matching function for call to 'std::__hash_enum<std::pair<long long unsigned int, int>, false>::__hash_enum()'
/usr/include/c++/10/bits/functional_hash.h:82:7: note: candidate: 'std::__hash_enum<_Tp, <anonymous> >::__hash_enum(std::__hash_enum<_Tp, <anonymous> >&&) [with _Tp = std::pair<long long unsigned int, int>; bool <anonymous> = false]'
   82 |       __hash_enum(__hash_enum&&);
      |       ^~~~~~~~~~~
/usr/include/c++/10/bits/functional_hash.h:82:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/10/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<long long unsigned int, int>; bool <anonymous> = false]' is private within this context
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: error: use of deleted function 'std::hash<std::pair<long long unsigned int, int> >::~hash()'
 1112 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/unordered_set:45,
                 from lang.cpp:4:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<long long unsigned int, int> >::~hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<long long unsigned int, int>; bool <anonymous> = false]' is private within this context
/usr/include/c++/10/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<long long unsigned int, int> >, true>::~_Hashtable_ebo_helper()'
 1368 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1109:12: note: 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<long long unsigned int, int> >, true>::~_Hashtable_ebo_helper()' is implicitly deleted because the default definition would be ill-formed:
 1109 |     struct _Hashtable_ebo_helper<_Nm, _Tp, true>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1109:12: error: use of deleted function 'std::hash<std::pair<long long unsigned int, int> >::~hash()'
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: error: use of deleted function 'std::__detail::_Hash_code_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
 1791 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1341:12: note: 'std::__detail::_Hash_code_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()' is implicitly deleted because the default definition would be ill-formed:
 1341 |     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1342 |       _Default_ranged_hash, true>
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1341:12: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<long long unsigned int, int> >, true>::~_Hashtable_ebo_helper()'
In file included from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable.h:451:7: error: use of deleted function 'std::__detail::_Hashtable_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::equal_to<std::pair<long long unsigned int, int> >, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::~_Hashtable_base()'
  451 |       _Hashtable() = default;
      |       ^~~~~~~~~~
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_set:46,
                 from lang.cpp:4:
/usr/include/c++/10/bits/hashtable_policy.h:1725:10: note: 'std::__detail::_Hashtable_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::equal_to<std::pair<long long unsigned int, int> >, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::~_Hashtable_base()' is implicitly deleted because the default definition would be ill-formed:
 1725 |   struct _Hashtable_base
      |          ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1725:10: error: use of deleted function 'std::__detail::_Hash_code_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
lang.cpp:19:30: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >]'
   19 | unordered_set<pair<ll, int>> xxx;
      |                              ^~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:50:36: error: cannot convert 'll' {aka 'long long unsigned int'} to 'const key_type&' {aka 'const std::pair<long long unsigned int, int>&'}
   50 |             cnt += x.count(t * 100 + i) + xxx.count(t2 * 100 + i);
      |                            ~~~~~~~~^~~
      |                                    |
      |                                    ll {aka long long unsigned int}
In file included from /usr/include/c++/10/unordered_set:47,
                 from lang.cpp:4:
/usr/include/c++/10/bits/unordered_set.h:667:29: note:   initializing argument 1 of 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type std::unordered_set<_Value, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_type = std::pair<long long unsigned int, int>]'
  667 |       count(const key_type& __x) const
      |             ~~~~~~~~~~~~~~~~^~~
lang.cpp:50:62: error: cannot convert 'll' {aka 'long long unsigned int'} to 'const key_type&' {aka 'const std::pair<long long unsigned int, int>&'}
   50 |             cnt += x.count(t * 100 + i) + xxx.count(t2 * 100 + i);
      |                                                     ~~~~~~~~~^~~
      |                                                              |
      |                                                              ll {aka long long unsigned int}
In file included from /usr/include/c++/10/unordered_set:47,
                 from lang.cpp:4:
/usr/include/c++/10/bits/unordered_set.h:667:29: note:   initializing argument 1 of 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type std::unordered_set<_Value, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_type = std::pair<long long unsigned int, int>]'
  667 |       count(const key_type& __x) const
      |             ~~~~~~~~~~~~~~~~^~~
lang.cpp:58:29: error: no matching function for call to 'std::unordered_set<std::pair<long long unsigned int, int> >::insert(ll)'
   58 |         x.insert(t * 100 + i);
      |                             ^
In file included from /usr/include/c++/10/unordered_set:47,
                 from lang.cpp:4:
/usr/include/c++/10/bits/unordered_set.h:420:7: note: candidate: 'std::pair<typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::iterator, bool> std::unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(const value_type&) [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::iterator = std::__detail::_Hashtable_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::equal_to<std::pair<long long unsigned int, int> >, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::iterator; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::value_type = std::pair<long long unsigned int, int>]'
  420 |       insert(const value_type& __x)
      |       ^~~~~~
/usr/include/c++/10/bits/unordered_set.h:420:32: note:   no known conversion for argument 1 from 'll' {aka 'long long unsigned int'} to 'const value_type&' {aka 'const std::pair<long long unsigned int, int>&'}
  420 |       insert(const value_type& __x)
      |              ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/unordered_set.h:424:7: note: candidate: 'std::pair<typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::iterator, bool> std::unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(std::unordered_set<_Value, _Hash, _Pred, _Alloc>::value_type&&) [with _Value = std::pair<long long unsigned int, int>; _Hash = std::hash<std::pair<long long unsigned int, int> >; _Pred = std::equal_to<std::pair<long long unsigned int, int> >; _Alloc = std::allocator<std::pair<long long unsigned int, int> >; typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::iterator = std::__detail::_Hashtable_base<std::pair<long long unsigned int, int>, std::pair<long long unsigned int, int>, std::__detail::_Identity, std::equal_to<std::pair<long long unsigned int, int> >, std::hash<std::pair<long long unsigned int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::iterator; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::value_type = std::pair<long long unsigned int, int>]'
  424 |       insert(value_t