Submission #936261

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9362612024-03-01 13:46:14velislavgarkovBitaro’s Party (JOI18_bitaro)C++14
100 / 100
1202 ms371540 KiB
#include <iostream>
#include <vector>
using namespace std;
#define endl '\n'
const int MAXN=1e5+10;
const int BUCK=450;
vector <int> v[MAXN], op[MAXN];
vector <pair <int,int> > best[MAXN], help;
int lazy[MAXN], dp[MAXN];
bool used[MAXN];
int n;
void merge_sort(int i, int j) {
int bri, brj, cnt, gr;
bri=brj=cnt=0;
while (cnt<BUCK && (bri<best[i].size() || brj<best[j].size())) {
if (bri==best[i].size()) {
help.push_back(best[j][brj]);
used[best[j][brj].second]=true;
brj++;
} else if (brj==best[j].size()) {
help.push_back(best[i][bri]);
used[best[i][bri].second]=true;
bri++;
} else if (used[best[i][bri].second]) {
bri++;
continue;
} else if (used[best[j][brj].second]) {
brj++;
continue;
} else if (best[i][bri].first>best[j][brj].first) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'void merge_sort(int, int)':
bitaro.cpp:15:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     while (cnt<BUCK && (bri<best[i].size() || brj<best[j].size())) {
      |                         ~~~^~~~~~~~~~~~~~~
bitaro.cpp:15:50: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     while (cnt<BUCK && (bri<best[i].size() || brj<best[j].size())) {
      |                                               ~~~^~~~~~~~~~~~~~~
bitaro.cpp:16:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         if (bri==best[i].size()) {
      |             ~~~^~~~~~~~~~~~~~~~
bitaro.cpp:20:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         } else if (brj==best[j].size()) {
      |                    ~~~^~~~~~~~~~~~~~~~
bitaro.cpp: In function 'int main()':
bitaro.cpp:75:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   75 |         for (int j=0;j<best[i].size();j++) {
      |                      ~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...