Submission #546899

#TimeUsernameProblemLanguageResultExecution timeMemory
546899fvogel499Roller Coaster Railroad (IOI16_railroad)C++17
Compilation error
0 ms0 KiB
/* * File created on 04/08/2022 at 21:58:56. * Link to problem: * Description: * Time complexity: O() * Space complexity: O() * Status: --- * Copyright: Ⓒ 2022 Francois Vogel */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace std; using namespace __gnu_pbds; #define pii pair<int, int> #define f first #define s second #define vi vector<int> #define all(x) x.begin(), x.end() #define size(x) (int)((x).size()) #define pb push_back #define ins insert #define cls clear #define itn ll #define ll long long #define ld long double typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; ll plan_roller_coaster(vi& from, vi& to) { map<int, int> m; for (int i = 0; i < size(from); i++) { if (!m.count(from[i])) m[from[i]] = i; m[from[i]]++; if (!m.count(to[i])) m[to[i]] = i; m[to[i]]--; } int sum = 0; for (auto i : m) { sum += i.s; if (sum > 1) return 1; } return 0; } signed main() { cin.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; vi from(n), to(n); for (int i = 0; i < n; i++) cin >> from[i]; for (int i = 0; i < n; i++) cin >> to[i]; cout << plan_roller_coaster(from, to) << endl; cout.flush(); int d = 0; d++; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc1bxBhs.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccbH3zfs.o:railroad.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc1bxBhs.o: in function `main':
grader.cpp:(.text.startup+0xf4): undefined reference to `plan_roller_coaster(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status