Submission #800188

#TimeUsernameProblemLanguageResultExecution timeMemory
800188TFFFloppy (RMI20_floppy)C++17
0 / 100
27 ms2964 KiB
#include <stdlib.h> #include <string.h> #include <bits/stdc++.h> using namespace std; #include "floppy.h" void read_array(int subtask_id, const vector<int> &v) { string bits = ""; priority_queue<pair<int, int>> q; for (int i = 0; i < (int)v.size(); i++) { q.push({v[i], i}); } while (!q.empty()) { int aux = q.top().second; q.pop(); for (int i = 8; i >= 0; i--) { if (aux > (1 << i)) { aux -= (1 << i); bits += "1"; } else bits += "0"; } } save_to_floppy(bits); } vector<int> solve_queries(int subtask_id, int N, const string &bits, const vector<int> &a, const vector<int> &b) { vector<int> answers = {}; vector<int> nums; for (int i = 0; i < N; i++) { int num = 0; for (int j = 0; j < 9; j++) { num += (bits[9 * i + j] == '1') * (1 << (8 - j)); } nums.push_back(num); } for (int i = 0; i < (int)a.size(); i++) { for (int j = 0; j < N; j++) { if (nums[j] >= a[i] || nums[j] <= b[i]) { answers.push_back(nums[j]); break; } } } return answers; }

Compilation message (stderr)

stub.cpp: In function 'void run2()':
stub.cpp:101:30: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  101 |     if (query_answers.size() != M) {
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...