Submission #937915

#TimeUsernameProblemLanguageResultExecution timeMemory
937915Muaath_5Game (IOI13_game)C++17
Compilation error
0 ms0 KiB
#ifdef MUAATH_5 #include "ioi.h" #else #include "game.h" #endif #pragma GCC optimize("Oz") #include <numeric> #define ll long long #define OUT 0 #define merge gcd using namespace std; const int N = 1'000'000'009; const int SZ = 4'500'000; struct ynode { ynode() : val(OUT), left(0), right(0) {} ll val; int left, right; }; struct xnode { xnode() : left(0), right(0), yy(0) {} int left, right; int yy; } root; int yyc = 1, xxc = 1; xnode xnds[SZ]; ynode ynds[SZ]; ll query_y(const int& qy1, const int& qy2, const ynode& node, int l = 0, int r = N - 1) { if (r < qy1 || qy2 < l) return OUT; if (qy1 <= l && r <= qy2) return node.val; const int mid = (l + r) / 2; return merge( (node.left ? query_y(qy1, qy2, ynds[node.left], l, mid) : OUT), (node.right ? query_y(qy1, qy2, ynds[node.right], mid + 1, r) : OUT) ); } ll query_x(const int& qx1, const int& qy1, const int& qx2, const int& qy2, const xnode& node, int l = 0, int r = N - 1) { if (r < qx1 || qx2 < l) return OUT; if (qx1 <= l && r <= qx2) return query_y(qy1, qy2, ynds[node.yy]); const int mid = (l + r) / 2; return merge( (node.left ? query_x(qx1, qy1, qx2, qy2, xnds[node.left], l, mid) : OUT), (node.right ? query_x(qx1, qy1, qx2, qy2, xnds[node.right], mid + 1, r) : OUT) ); } void update_y(const int& qy, const ll& val, ynode& node, int l = 0, int r = N - 1) { if (l == r) { node.val = val; return; } const int mid = (l + r) / 2; if (qy <= mid) { if (!node.left) node.left = yyc++; update_y(qy, val, ynds[node.left], l, mid); } else { if (!node.right) node.right = yyc++; update_y(qy, val, ynds[node.right], mid + 1, r); } node.val = merge((node.left ? ynds[node.left].val : OUT), (node.right ? ynds[node.right].val : OUT)); } void update_z(const int& qy, const ll& val, ynode& node, int l = 0, int r = N - 1) { if (l == r) { node.val = merge(node.val, val); return; } const int mid = (l + r) / 2; if (qy <= mid) { if (!node.left) node.left = yyc++; update_z(qy, val, ynds[node.left], l, mid); } else { if (!node.right) node.right = yyc++; update_z(qy, val, ynds[node.right], mid + 1, r); } node.val = merge((node.left ? ynds[node.left].val : OUT), (node.right ? ynds[node.right].val : OUT)); } void update_x(const int& qx, const int& qy, const ll& val, xnode& node, int l = 0, int r = N - 1) { if (!node.yy) node.yy = yyc++; if (l == r) { update_y(qy, val, ynds[node.yy]); return; } const int mid = (l + r) / 2; if (qx <= mid) { if (!node.left) node.left = xxc++; update_x(qx, qy, val, xnds[node.left], l, mid); } else { if (!node.right) node.right = xxc++; update_x(qx, qy, val, xnds[node.right], mid + 1, r); } update_z(qy, val, ynds[node.yy]); } void init(int R, int C) { root = xnode(); } void update(int x, int y, long long k) { update_x(x, y, k, root); } long long calculate(int x1, int y1, int x2, int y2) { return query_x(x1, y1, x2, y2, root); }

Compilation message (stderr)

game.cpp:6:26: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
    6 | #pragma GCC optimize("Oz")
      |                          ^
In file included from /usr/include/c++/10/bits/stl_iterator_base_types.h:67,
                 from /usr/include/c++/10/numeric:61,
                 from game.cpp:7:
/usr/include/c++/10/type_traits:62:45: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   62 |       constexpr operator value_type() const noexcept { return value; }
      |                                             ^~~~~~~~
/usr/include/c++/10/type_traits:67:47: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   67 |       constexpr value_type operator()() const noexcept { return value; }
      |                                               ^~~~~~~~
/usr/include/c++/10/type_traits:201:72: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  201 |     constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
      |                                                                        ^
/usr/include/c++/10/type_traits:211:53: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  211 |     >::type __is_complete_or_unbounded(_TypeIdentity)
      |                                                     ^
/usr/include/c++/10/type_traits:772:18: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  772 |     __declval(int);
      |                  ^
/usr/include/c++/10/type_traits:772:18: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/type_traits:776:19: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  776 |     __declval(long);
      |                   ^
/usr/include/c++/10/type_traits:776:19: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/type_traits:779:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  779 |     auto declval() noexcept -> decltype(__declval<_Tp>(0));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/type_traits:779:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/type_traits:805:34: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  805 |       static true_type __test(int);
      |                                  ^
/usr/include/c++/10/type_traits:808:35: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  808 |       static false_type __test(...);
      |                                   ^
/usr/include/c++/10/type_traits:856:17: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  856 |       __test(int);
      |                 ^
/usr/include/c++/10/type_traits:859:35: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  859 |       static false_type __test(...);
      |                                   ^
/usr/include/c++/10/type_traits:1201:36: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1201 |     static void __helper(const _Tp&);
      |                                    ^
/usr/include/c++/10/type_traits:1205:68: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1205 |                             decltype(__helper<const _Tp&>({}))* = 0);
      |                                                                    ^
/usr/include/c++/10/type_traits:1207:33: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1207 |     static false_type __test(...);
      |                                 ^
/usr/include/c++/10/type_traits:1429:31: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1429 |  static void __test_aux(_To1) noexcept;
      |                               ^~~~~~~~
/usr/include/c++/10/type_traits:1434:12: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1434 |  __test(int);
      |            ^
/usr/include/c++/10/type_traits:1438:12: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1438 |  __test(...);
      |            ^
/usr/include/c++/10/type_traits:1469:31: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1469 |  static void __test_aux(_To1) noexcept;
      |                               ^~~~~~~~
/usr/include/c++/10/type_traits:1474:12: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1474 |  __test(int);
      |            ^
/usr/include/c++/10/type_traits:1478:12: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 1478 |  __test(...);
      |            ^
/usr/include/c++/10/type_traits:2229:18: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2229 |       _S_test(int);
      |                  ^
/usr/include/c++/10/type_traits:2241:20: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2241 |       _S_test_2(...);
      |                    ^
/usr/include/c++/10/type_traits:2245:18: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2245 |       _S_test(...);
      |                  ^
/usr/include/c++/10/type_traits:2335:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2335 |     auto declval() noexcept -> decltype(__declval<_Tp>(0))
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/type_traits:2367:42: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2367 |       ), __invoke_memfun_ref> _S_test(int);
      |                                          ^
/usr/include/c++/10/type_traits:2370:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2370 |       static __failure_type _S_test(...);
      |                                        ^
/usr/include/c++/10/type_traits:2386:44: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2386 |       ), __invoke_memfun_deref> _S_test(int);
      |                                            ^
/usr/include/c++/10/type_traits:2389:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2389 |       static __failure_type _S_test(...);
      |                                        ^
/usr/include/c++/10/type_traits:2405:42: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2405 |       ), __invoke_memobj_ref> _S_test(int);
      |                                          ^
/usr/include/c++/10/type_traits:2408:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2408 |       static __failure_type _S_test(...);
      |                                        ^
/usr/include/c++/10/type_traits:2424:44: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2424 |       ), __invoke_memobj_deref> _S_test(int);
      |                                            ^
/usr/include/c++/10/type_traits:2427:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2427 |       static __failure_type _S_test(...);
      |                                        ^
/usr/include/c++/10/type_traits:2507:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2507 |       ), __invoke_other> _S_test(int);
      |                                     ^
/usr/include/c++/10/type_traits:2510:40: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2510 |       static __failure_type _S_test(...);
      |                                        ^
/usr/include/c++/10/type_traits:2655:53: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2655 |              is_nothrow_move_assignable<_Tp>>::value);
      |                                                     ^
/usr/include/c++/10/type_traits:2655:53: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/type_traits:2662:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2662 |     noexcept(__is_nothrow_swappable<_Tp>::value);
      |                                                ^
/usr/include/c++/10/type_traits:2662:48: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/type_traits:2671:36: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2671 |         static true_type __test(int);
      |                                    ^
/usr/include/c++/10/type_traits:2674:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2674 |         static false_type __test(...);
      |                                     ^
/usr/include/c++/10/type_traits:2682:21: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2682 |         > __test(int);
      |                     ^
/usr/include/c++/10/type_traits:2685:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2685 |         static false_type __test(...);
      |                                     ^
/usr/include/c++/10/type_traits:2757:36: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2757 |         static true_type __test(int);
      |                                    ^
/usr/include/c++/10/type_traits:2760:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2760 |         static false_type __test(...);
      |                                     ^
/usr/include/c++/10/type_traits:2770:21: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2770 |         > __test(int);
      |                     ^
/usr/include/c++/10/type_traits:2773:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2773 |         static false_type __test(...);
      |                                     ^
/usr/include/c++/10/type_traits:2860:44: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2860 |       static typename _Result::type _S_get();
      |                                            ^
/usr/include/c++/10/type_traits:2863:25: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2863 |  static void _S_conv(_Tp);
      |                         ^
/usr/include/c++/10/type_traits:2868:13: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2868 |  _S_test(int);
      |             ^
/usr/include/c++/10/type_traits:2872:13: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2872 |  _S_test(...);
      |             ^
/usr/include/c++/10/type_traits:2885:52: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2885 |     constexpr bool __call_is_nt(__invoke_memfun_ref)
      |                                                    ^
/usr/include/c++/10/type_traits:2893:54: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2893 |     constexpr bool __call_is_nt(__invoke_memfun_deref)
      |                                                      ^
/usr/include/c++/10/type_traits:2900:52: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2900 |     constexpr bool __call_is_nt(__invoke_memobj_ref)
      |                                                    ^
/usr/include/c++/10/type_traits:2907:54: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2907 |     constexpr bool __call_is_nt(__invoke_memobj_deref)
      |                                                      ^
/usr/include/c++/10/type_traits:2913:47: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2913 |     constexpr bool __call_is_nt(__invoke_other)
      |                                               ^
/usr/include/c++/10/type_traits:2940:21: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2940 |     ~__nonesuch() = delete;
      |                     ^~~~~~
/usr/include/c++/10/type_traits:2941:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2941 |     __nonesuch(__nonesuch const&) = delete;
      |                                     ^~~~~~
/usr/include/c++/10/type_traits:2942:41: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
 2942 |     void operator=(__nonesuch const&) = delete;
      |                                         ^~~~~~
In file included from /usr/include/c++/10/numeric:61,
                 from game.cpp:7:
/usr/include/c++/10/bits/stl_iterator_base_types.h:238:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  238 |     __iterator_category(const _Iter&)
      |                                     ^
In file included from /usr/include/c++/10/numeric:60,
                 from game.cpp:7:
/usr/include/c++/10/bits/move.h:49:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   49 |     __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
      |                           ^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/bits/stl_numeric.h:61,
                 from /usr/include/c++/10/numeric:62,
                 from game.cpp:7:
/usr/include/c++/10/bits/move.h:76:61: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   76 |     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
      |                                                             ^~~~~~~~
/usr/include/c++/10/bits/move.h:87:62: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   87 |     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
      |                                                              ^~~~~~~~
/usr/include/c++/10/bits/move.h:101:21: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  101 |     move(_Tp&& __t) noexcept
      |                     ^~~~~~~~
/usr/include/c++/10/bits/move.h:121:32: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  121 |     move_if_noexcept(_Tp& __x) noexcept
      |                                ^~~~~~~~
/usr/include/c++/10/bits/move.h:140:25: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  140 |     addressof(_Tp& __r) noexcept
      |                         ^~~~~~~~
/usr/include/c++/10/bits/move.h:146:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  146 |     const _Tp* addressof(const _Tp&&) = delete;
      |                                     ^
/usr/include/c++/10/bits/move.h:146:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/bits/move.h:152:43: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  152 |     __exchange(_Tp& __obj, _Up&& __new_val)
      |                                           ^
In file included from /usr/include/c++/10/numeric:60,
                 from game.cpp:7:
/usr/include/c++/10/bits/move.h:190:5: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  190 |     _GLIBCXX_NOEXCEPT_IF(__and_<is_nothrow_move_constructible<_Tp>,
      |     ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/move.h:214:5: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  214 |     _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Tp>::value)
      |     ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/numeric:62,
                 from game.cpp:7:
/usr/include/c++/10/bits/stl_numeric.h:88:72: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   88 |     iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
      |                                                                        ^
/usr/include/c++/10/bits/stl_numeric.h:134:73: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |                                                                         ^
/usr/include/c++/10/bits/stl_numeric.h:162:37: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  162 |         _BinaryOperation __binary_op)
      |                                     ^
/usr/include/c++/10/bits/stl_numeric.h:191:41: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  191 |     _InputIterator2 __first2, _Tp __init)
      |                                         ^
/usr/include/c++/10/bits/stl_numeric.h:226:35: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  226 |     _BinaryOperation2 __binary_op2)
      |                                   ^
/usr/include/c++/10/bits/stl_numeric.h:257:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  257 |   _OutputIterator __result)
      |                           ^
/usr/include/c++/10/bits/stl_numeric.h:299:57: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  299 |   _OutputIterator __result, _BinaryOperation __binary_op)
      |                                                         ^
/usr/include/c++/10/bits/stl_numeric.h:339:51: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  339 |    _InputIterator __last, _OutputIterator __result)
      |                                                   ^
/usr/include/c++/10/bits/stl_numeric.h:383:58: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  383 |    _OutputIterator __result, _BinaryOperation __binary_op)
      |                                                          ^
In file included from game.cpp:7:
/usr/include/c++/10/numeric:89:29: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   89 |     __abs_integral(_Tp __val)
      |                             ^
/usr/include/c++/10/numeric:95:29: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   95 |     __abs_integral(_Tp __val)
      |                             ^
/usr/include/c++/10/numeric:98:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
   98 |   void __abs_integral(bool) = delete;
      |                           ^
/usr/include/c++/10/numeric:98:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
/usr/include/c++/10/numeric:102:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  102 |     __gcd(_Mn __m, _Nn __n)
      |                           ^
/usr/include/c++/10/numeric:112:27: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  112 |     __lcm(_Mn __m, _Nn __n)
      |                           ^
/usr/include/c++/10/numeric:131:25: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  131 |     gcd(_Mn __m, _Nn __n)
      |                         ^
/usr/include/c++/10/numeric:145:25: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  145 |     lcm(_Mn __m, _Nn __n)
      |                         ^
In file included from /usr/include/c++/10/numeric:223,
                 from game.cpp:7:
/usr/include/c++/10/bits/stl_function.h:171:50: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
  171 |       operator()(const _Tp& __x, const _Tp