Submission #401624

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4016242021-05-10 15:03:24maximath_1Floppy (RMI20_floppy)C++17
100 / 100
151 ms15160 KiB
#include <bits/stdc++.h>
#include "floppy.h"
using namespace std;
const int MX = 1e5;
pair<int, int> st[MX * 4];
vector<int> _v;
int n;
string bits = "";
void build(int nd, int cl, int cr){
if(cl == cr) return void(st[nd] = {_v[cl], cl});
build(nd * 2, cl, (cl + cr) / 2);
build(nd * 2 + 1, (cl + cr) / 2 + 1, cr);
st[nd] = max(st[nd * 2], st[nd * 2 + 1]);
}
pair<int, int> que(int nd, int cl, int cr, int lf, int rg){
if(lf > rg || cr < lf || rg < cl) return {-2000000000, -1};
if(lf <= cl && cr <= rg) return st[nd];
pair<int, int> L = que(nd * 2, cl, (cl + cr) / 2, lf, rg);
pair<int, int> R = que(nd * 2 + 1, (cl + cr) / 2 + 1, cr, lf, rg);
return max(L, R);
}
void create(int lf, int rg){
int nw = que(1, 0, n - 1, lf, rg).second;
if(lf <= nw - 1){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

floppy.cpp: In function 'std::vector<int> solve_queries(int, int, const string&, const std::vector<int>&, const std::vector<int>&)':
floppy.cpp:96:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   96 |  for(int i = 0; i < a.size(); i ++)
      |                 ~~^~~~~~~~~~
stub.cpp: In function 'void run2()':
stub.cpp:101:30: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  101 |     if (query_answers.size() != M) {
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...