Submission #885568

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8855682023-12-10 07:45:26SkillIssueWAGuyThe Potion of Great Power (CEOI20_potion)C++14
100 / 100
2201 ms34756 KiB
#include<vector>
#include<utility>
#include<cmath>
#include<algorithm>
using namespace std;
namespace cj{
vector<int> h, a, b;
int n, d, u, sqrtu;
vector<vector<vector<int>>> big;
vector<vector<pair<int,int>>> graph;
vector<vector<vector<pair<int,int>>>> small;
vector<vector<int>> slots;
bool Comp(pair<int,int> A, pair<int,int> B){
if (h[A.first] == h[B.first]){
return A.first < B.first;
}
return h[A.first] < h[B.first];
}
bool C(int A, int B){
if (h[A] == h[B]){
return A < B;
}
return h[A] < h[B];
}
bool Comp2(pair<int,int> A, pair<int,int> B){
return A.second < B.second;
}
inline void push(vector<int> &V, int val){
if (V.empty()){
V.push_back(val);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

potion.cpp: In function 'void curseChanges(int, int*, int*)':
potion.cpp:90:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   90 |         for (int j = 0; j < cj::graph[i].size(); j++){
      |                         ~~^~~~~~~~~~~~~~~~~~~~~
potion.cpp:91:37: warning: comparison of integer expressions of different signedness: 'std::vector<std::vector<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   91 |             if (cj::small[i].size() == cj::sqrtu){
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
potion.cpp:106:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |         for (int j = 0; j < cj::small[i].size(); j++){
      |                         ~~^~~~~~~~~~~~~~~~~~~~~
potion.cpp: In function 'void genseq(int, int, std::vector<int>&)':
potion.cpp:128:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |     while (p1 < s.size() || p2 < cj::big[x][slot].size()){
      |            ~~~^~~~~~~~~~
potion.cpp:128:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |     while (p1 < s.size() || p2 < cj::big[x][slot].size()){
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
potion.cpp:129:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  129 |         if (p1 == s.size()){
      |             ~~~^~~~~~~~~~~
potion.cpp:133:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  133 |         else if (p2 == cj::big[x][slot].size()){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
potion.cpp: In function 'int question(int, int, int)':
potion.cpp:155:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  155 |     while (p1 < xseq.size() && p2 < yseq.size()){
      |            ~~~^~~~~~~~~~~~~
potion.cpp:155:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  155 |     while (p1 < xseq.size() && p2 < yseq.size()){
      |                                ~~~^~~~~~~~~~~~~
potion.cpp: In function 'void genseq(int, int, std::vector<int>&)':
potion.cpp:122:45: warning: 'slot' may be used uninitialized in this function [-Wmaybe-uninitialized]
  122 |     for (pair<int,int> i : cj::small[x][slot]){
      |                                             ^
#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...