Submission #1218392

#TimeUsernameProblemLanguageResultExecution timeMemory
1218392damamilaFloppy (RMI20_floppy)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //~ #define int long long //~ string str; void save_to_floppy(const string &bits); //~ void save_to_floppy(const string &bits) { //~ str = bits; //~ } void read_array(int subtask_id, const vector<int> &v) { int n = v.size(); string res; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { pair<int, int> ans = {v[i], i}; for (int k = i+1; k <= j; k++) { if (v[k] > ans.first) ans = {v[k], k}; } for (int k = 0; k < n; k++) { if (ans.second == k) res.push_back('1'); else res.push_back('0'); } } } save_to_floppy(res); } vector<int> solve_queries(int subtask_id, int N, string &bits, vector<int> &a, vector<int> &b) { vector<int> ans; for (int q = 0; q < (int)a.size(); q++) { int start = 0; for (int i = 0; i < a[q]; i++) { start += (N-i)*N; } for (int i = a[q]; i < b[q]; i++) { start += N; } //~ cout << start << endl; for (int i = 0; i < N; i++) { if (bits[i+start] == '1') ans.push_back(i); } } //~ for (int i : ans) cout << i << endl; return ans; } //~ signed main() { //~ read_array(3, {40, 20, 30 , 1}); //~ vector<int> a = {0, 0, 0, 0, 1, 1, 1, 2, 2, 3}; //~ vector<int> b = {0, 1, 2, 3, 1, 2, 3, 2, 3, 3}; //~ cout << str << endl; //~ solve_queries(3, 4, str, a, b); //~ }

Compilation message (stderr)

/usr/bin/ld: /tmp/cceDd446.o: in function `run2()':
stub.cpp:(.text+0x6e8): undefined reference to `solve_queries(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&)'
collect2: error: ld returned 1 exit status