Submission #630122

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6301222022-08-15 17:38:43truc12a2cvpDistributing Candies (IOI21_candies)C++17
100 / 100
735 ms48452 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> II;
const int N = 2e5 + 5, logN = 20;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
/*
//subtask 3
struct F{
int L, R, sum;
F(int _L = 0, int _R = 0, int _sum = 0) : L(_L), R(_R), sum(_sum) {}
F operator + (const F& op) const{
return F(max(op.L, min(op.R, L + op.sum)),
max(op.L, min(op.R, R + op.sum)),
sum + op.sum);
}
};
int C;
struct ST_lazy{
int n;
vector<F> ST;
ST_lazy(int _n = 0){
n = _n;
ST.resize(4 * n + 5);
}
void down(int id, int l, int r){
if(l == r) return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

candies.cpp: In member function 'void ST_lazy::update(int, int, int, int, int, int)':
candies.cpp:126:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  126 |               int mid = l + r >> 1;
      |                         ~~^~~
candies.cpp: In member function 'II ST_lazy::get(int, int, int, int, int)':
candies.cpp:136:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  136 |               int mid = l + r >> 1;
      |                         ~~^~~
candies.cpp: In member function 'int ST_lazy::BS(int, int, int, int, ll, ll)':
candies.cpp:143:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  143 |               int mid = l + r >> 1;
      |                         ~~^~~
#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...