Submission #553482

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5534822022-04-26 02:47:58quocnguyen1012Street Lamps (APIO19_street_lamps)C++14
100 / 100
2473 ms149704 KiB
#include "bits/stdc++.h"
using namespace std;
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
bool first = true;
string res = "{";
for (const auto &x : v) {
if (!first) {
res += ", ";
}
first = false;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

street_lamps.cpp: In lambda function:
street_lamps.cpp:137:7: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
  137 |       while (j <= n and s[i] == s[j]) ++j; --j;
      |       ^~~~~
street_lamps.cpp:137:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
  137 |       while (j <= n and s[i] == s[j]) ++j; --j;
      |                                            ^~
street_lamps.cpp: In function 'int main()':
street_lamps.cpp:151:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  151 |   for (auto [l, r] : intervals) {
      |             ^
street_lamps.cpp:156:16: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  156 |     const auto&[op, a, b] = queries[i];
      |                ^
street_lamps.cpp:194:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  194 |         auto [l, r] = (*it);
      |              ^
street_lamps.cpp:201:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  201 |     for (auto [x, y, ignore] : addSeg[i]) t.fakeupdate(x, y);
      |               ^
street_lamps.cpp:202:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  202 |     for (auto [x, y, ignore] : delSeg[i]) t.fakeupdate(x, y);
      |               ^
street_lamps.cpp:206:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  206 |     for (auto [x, y, id] : addSeg[i]) {
      |               ^
street_lamps.cpp:48:20: warning: statement has no effect [-Wunused-value]
   48 | #define debug(...) 42
      |                    ^~
street_lamps.cpp:207:7: note: in expansion of macro 'debug'
  207 |       debug("add", x, y, id);
      |       ^~~~~
street_lamps.cpp:210:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  210 |     for (auto [x, y, id] : delSeg[i]){
      |               ^
street_lamps.cpp:48:20: warning: statement has no effect [-Wunused-value]
   48 | #define debug(...) 42
      |                    ^~
street_lamps.cpp:212:7: note: in expansion of macro 'debug'
  212 |       debug("del", x, y, id);
      |       ^~~~~
street_lamps.cpp:214:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  214 |     auto [op, a, b] = queries[i];
      |          ^
street_lamps.cpp:48:20: warning: statement has no effect [-Wunused-value]
   48 | #define debug(...) 42
      |                    ^~
street_lamps.cpp:217:7: note: in expansion of macro 'debug'
  217 |       debug(res);
      |       ^~~~~
#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...