Submission #732129

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7321292023-04-28 14:03:05beabossCircus (Balkan15_CIRCUS)C++14
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
#define s second
#define f first
#define pb push_back
// typedef long long ll;
typedef int ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
// const ll N = 100001;
deque<pii> vals;
void init(int n, int m, int x[]){
vals.pb({m - 0, m});
for (ll i = n - 1; i>= 0; i--) {
auto it = lower_bound(vals.begin(), vals.end(), make_pair(x[i], -1)) - vals.begin();
// cout << x[i] << vals[it].s << (vals[it].s - x[i]) << endl;
while (vals.size() > 0 && x[i] - (vals[it].s - x[i]) > vals.front().f) vals.pop_front()
vals.push_front({x[i] - (vals[it].s - x[i]), x[i]});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

circus.cpp: In function 'void init(int, int, int*)':
circus.cpp:27:90: error: expected ';' before 'vals'
   27 |   while (vals.size() > 0 && x[i] - (vals[it].s - x[i]) > vals.front().f) vals.pop_front()
      |                                                                                          ^
      |                                                                                          ;
   28 |   vals.push_front({x[i] - (vals[it].s - x[i]), x[i]});
      |   ~~~~                                                                                    
circus.cpp:28:53: error: expected primary-expression before ')' token
   28 |   vals.push_front({x[i] - (vals[it].s - x[i]), x[i]});
      |                                                     ^
grader.cpp: In function 'int main()':
grader.cpp:14:12: warning: unused variable 'max_code' [-Wunused-variable]
   14 |  long long max_code;
      |            ^~~~~~~~
grader.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf("%d%d", &N, &M);
      |  ~~~~~^~~~~~~~~~~~~~~~
grader.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf("%d", &P[i]);
      |   ~~~~~^~~~~~~~~~~~~
grader.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |  scanf("%d", &Q);
      |  ~~~~~^~~~~~~~~~
grader.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |   scanf("%d", &d);
      |   ~~~~~^~~~~~~~~~