Submission #1292618

#TimeUsernameProblemLanguageResultExecution timeMemory
1292618MinbaevFactories (JOI14_factories)C++20
Compilation error
0 ms0 KiB
#include "factories.h"
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ar array

const int NN = 500000 + 5;

struct Bit {
    int sz;
    vector<long long> t, bn;
    Bit (int n = 0){
        this->sz = n;
        t.assign(sz * 4 + 5, 0);
        bn.assign(sz * 4 + 5, -1LL);
    }

    void push(int tl, int tr, int v){
        if(bn[v] == -1LL) return;
        if(tl != tr){
            bn[v*2] = bn[v];
            bn[v*2+1] = bn[v];
        }
        t[v] = (long long)(tr - tl + 1) * bn[v];
        bn[v] = -1LL;
    }

    void update(int tl, int tr, int v, int l, int r, long long val){
        push(tl, tr, v);
        if(r < l || tr < l || r < tl) return;
        if(l <= tl && tr <= r){
            bn[v] = val;

Compilation message (stderr)

factories.cpp:33:25: error: expected '}' at end of input
   33 |             bn[v] = val;
      |                         ^
factories.cpp:10:12: note: to match this '{'
   10 | struct Bit {
      |            ^
factories.cpp: In member function 'void Bit::update(int, int, int, int, int, long long int)':
factories.cpp:33:25: error: expected '}' at end of input
   33 |             bn[v] = val;
      |                         ^
factories.cpp:32:31: note: to match this '{'
   32 |         if(l <= tl && tr <= r){
      |                               ^
factories.cpp:33:25: error: expected '}' at end of input
   33 |             bn[v] = val;
      |                         ^
factories.cpp:29:68: note: to match this '{'
   29 |     void update(int tl, int tr, int v, int l, int r, long long val){
      |                                                                    ^
factories.cpp: At global scope:
factories.cpp:33:25: error: expected unqualified-id at end of input
   33 |             bn[v] = val;
      |                         ^