Submission #379672

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3796722021-03-19 02:19:502qbingxuanSegments (IZhO18_segments)C++14
100 / 100
2082 ms18300 KiB
#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(a...) qqbx(#a, a)
template <typename ...T> void qqbx(const char *s, T ...a) {
int cnt = sizeof...(T);
((std::cerr << "\033[1;32m(" << s << ") = (") , ... , (std::cerr << a << (--cnt ? ", " : ")\033[0m\n")));
}
#else
#define safe ((void)0)
#define debug(...) ((void)0)
#endif // local
#define all(v) begin(v),end(v)
using namespace std;
using namespace __gnu_pbds;
template <typename T> using rbt = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef int64_t ll;
const int maxc = 2e9, inf = 1e9, K1 = 1424, K2 = 1424, maxn = 200025;
pair<int,int> seg[maxn];
int segId = 0;
vector<tuple<int,int,int>> recent, total;
vector<tuple<int,int,int>> block[maxn];
int maxLen[maxn], minLen[maxn], blockCnt;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

segments.cpp:2: warning: ignoring #pragma loop_opt  [-Wunknown-pragmas]
    2 | #pragma loop_opt(on)
      | 
segments.cpp: In function 'bool cmpLen(std::tuple<int, int, int>, std::tuple<int, int, int>)':
segments.cpp:57:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   57 |     auto [al, ar, av] = a;
      |          ^
segments.cpp:58:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   58 |     auto [bl, br, bv] = b;
      |          ^
segments.cpp: In function 'void build()':
segments.cpp:71:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |     for (int i = 0; i < total.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~
segments.cpp:72:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   72 |         auto [l, r, v] = total[i];
      |              ^
segments.cpp: In function 'int query(int, int, int)':
segments.cpp:112:23: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  112 |             for (auto [nl, nr, v]: block[i]) {
      |                       ^
segments.cpp:122:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  122 |     for (auto [nl, nr, v]: recent) {
      |               ^
segments.cpp: In function 'int main()':
segments.cpp:152:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  152 |             auto [a, b] = seg[id];
      |                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...