Submission #599903

#TimeUsernameProblemLanguageResultExecution timeMemory
599903cheissmartRoller Coaster Railroad (IOI16_railroad)C++14
Compilation error
0 ms0 KiB
#include "railroad.h"
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

ll plan_roller_coaster(vi s, vi t) {
    int n = SZ(s);
    V<pi> tt;
    tt.EB(-INF, -1);
    tt.EB(INF, 1);
    for(int i = 0; i < n; i++) {
        tt.EB(s[i], -1);
        tt.EB(t[i], 1);
    }
    sort(ALL(tt));
    ll s = 0;
    for(int i = 0; i < SZ(tt); i++) {
        s += tt[i].S;
        if(s > 0) return 0;
    }
    return 330;
}

Compilation message (stderr)

railroad.cpp: In function 'll plan_roller_coaster(vi, vi)':
railroad.cpp:31:8: error: declaration of 'll s' shadows a parameter
   31 |     ll s = 0;
      |        ^
railroad.cpp:21:27: note: 'vi s' previously declared here
   21 | ll plan_roller_coaster(vi s, vi t) {
      |                        ~~~^