Submission #1016594

#TimeUsernameProblemLanguageResultExecution timeMemory
1016594MohamedFaresNebiliThe Collection Game (BOI21_swaps)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "swaps.h" using namespace std; vector<int> dcS(vector<int> A) { if(A.size() <= 1) return A; vector<int> X, Y; int N = A.size(); for(int l = 0; l < N / 2; l++) X.push_back(A[l]); for(int l = N / 2; l < N; l++) Y.push_back(A[l]); X = dcS(X), Y = dcS(Y); int i = 0, j = 0; while(i != X.size() || j != Y.size()) { if(i == X.size()) A.push_back(Y[j++]); else if(j == Y.size()) A.push_back(X[i++]); else { schedule(X[i], Y[j]); vector<int> K = visit(); if(K[0] == 0) A.push_back(Y[j++]); else A.push_back(X[i++]); } } return A; } void solve(int N, int V) { vector<int> res(N); for(int l = 0; l < N; l++) res[l] = l + 1; res = dcS(res); answer(res); }

Compilation message (stderr)

swaps.cpp: In function 'std::vector<int> dcS(std::vector<int>)':
swaps.cpp:16:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |                 while(i != X.size() || j != Y.size()) {
      |                       ~~^~~~~~~~~~~
swaps.cpp:16:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |                 while(i != X.size() || j != Y.size()) {
      |                                        ~~^~~~~~~~~~~
swaps.cpp:17:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |                     if(i == X.size()) A.push_back(Y[j++]);
      |                        ~~^~~~~~~~~~~
swaps.cpp:18:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |                     else if(j == Y.size()) A.push_back(X[i++]);
      |                             ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...