Submission #844856

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8448562023-09-06 05:43:22ogkostyaOvertaking (IOI23_overtaking)C++17
0 / 100
1 ms604 KiB
#include "overtaking.h"
#include <algorithm>
#include <utility>
#include <list>
#include <climits>
std::vector<std::vector<std::pair<long long, long long>>> SS(1001, std::vector<std::pair<long long, long long>>());
struct sort1
{
inline bool operator() (const std::pair<long long, int>& a, const std::pair<long long, int>& b)
{
if (a.first == b.first)
return a.second < b.second;
return a.first < b.first;
}
};
class leaf
{
public:
leaf(long long _a, long long _b, long long _r)
{
a = _a;
b = _b;
r = _r;
}
long long a, b, r;
};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

overtaking.cpp: In function 'void init(int, int, std::vector<long long int>, std::vector<int>, int, int, std::vector<int>)':
overtaking.cpp:127:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  127 |         for (int i = 0; i < TW.size(); i++)
      |                         ~~^~~~~~~~~~~
overtaking.cpp:137:73: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  137 |             if (SS[j].size() == 0 || SS[j].back().second != b && (i + 1 == TW.size() || TW[i].first != TW[i + 1].first))
      |                                                                   ~~~~~~^~~~~~~~~~~~
overtaking.cpp:137:63: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  137 |             if (SS[j].size() == 0 || SS[j].back().second != b && (i + 1 == TW.size() || TW[i].first != TW[i + 1].first))
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
overtaking.cpp:156:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<leaf>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  156 |             while (curr_i < curr.size())
      |                    ~~~~~~~^~~~~~~~~~~~~
overtaking.cpp:175:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  175 |                     if (i + 1 == TW.size() || TW[i + 1].first > curr[curr_i].r)
      |                         ~~~~~~^~~~~~~~~~~~
overtaking.cpp: In function 'long long int arrival_time(long long int)':
overtaking.cpp:216:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<leaf>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  216 |             if (m == ans.size())
      |                 ~~^~~~~~~~~~~~~
overtaking.cpp: In function 'std::vector<leaf> J(std::vector<leaf>&)':
overtaking.cpp:91:13: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
   91 |             if (b >= ma)
      |             ^~
overtaking.cpp:24:11: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
   24 |         a = _a;
      |         ~~^~~~
overtaking.cpp:54:19: note: 'a' was declared here
   54 |         long long a, b, r = -1, ma = LLONG_MAX;
      |                   ^
#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...