Submission #957186

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9571862024-04-03 06:52:07Vladth11Overtaking (IOI23_overtaking)C++17
100 / 100
3256 ms1013904 KiB
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#include "overtaking.h"
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
const int NMAX = 31000001;
const ll INF = 1e18;
const pii NEUTRU = {0, 0};
struct Node {
/// max(x + a, b)
int st, dr;
ll maxi; /// basically asta e valoarea lui f(dr)
pii lazy;
ll eval(ll x) {
return max(x + lazy.first, lazy.second);
}
};
Node aint[NMAX];
int cnt;
pii combine(pii nou, pii a) {
return {a.first + nou.first, max(a.second + nou.first, nou.second)};
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

overtaking.cpp: In function 'void init(int, int, std::vector<long long int>, std::vector<int>, int, int, std::vector<int>)':
overtaking.cpp:142:50: warning: capture of variable 'panaAcum' with non-automatic storage duration
  142 |         sort(indici.begin(), indici.end(), [&W, &panaAcum](const int &a, const int &b) {
      |                                                  ^~~~~~~~
overtaking.cpp:125:4: note: 'll panaAcum [1001]' declared here
  125 | ll panaAcum[1001];
      |    ^~~~~~~~
overtaking.cpp:147:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  147 |         for(int j = 0; j < indici.size(); j++) {
      |                        ~~^~~~~~~~~~~~~~~
overtaking.cpp:152:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  152 |         for(int j = 0; j < indici.size(); j++) {
      |                        ~~^~~~~~~~~~~~~~~
#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...