Submission #413644

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4136442021-05-29 07:31:05BertedRoad Closures (APIO21_roads)C++14
100 / 100
202 ms40844 KiB
#include "roads.h"
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#define ll long long
#define pii pair<ll, ll>
#define ppi pair<pii, ll>
#define fst first
#define snd second
using namespace std;
vector<pii> adj[100001];
vector<ll> temp;
namespace BIT
{
vector<ll> C;
ll BIT[100001][2];
inline void reset()
{
for (int i = 0; i <= C.size(); i++) {BIT[i][0] = BIT[i][1] = 0;}
C.clear();
}
inline void pushPoint(ll x) {C.push_back(x);}
inline void process() {sort(C.begin(), C.end()); C.resize(unique(C.begin(), C.end()) - C.begin());}
inline ll query(int t, ll x)
{
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

roads.cpp: In function 'void BIT::reset()':
roads.cpp:24:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for (int i = 0; i <= C.size(); i++) {BIT[i][0] = BIT[i][1] = 0;}
      |                   ~~^~~~~~~~~~~
roads.cpp: In function 'void BIT::update(int, int, long long int)':
roads.cpp:46:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |   for (; x <= C.size(); x += x & (-x)) {BIT[x][t] += v;}
      |          ~~^~~~~~~~~~~
roads.cpp: In function 'long long int BIT::findKth(int)':
roads.cpp:53:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   53 |    int M = L + R >> 1;
      |            ~~^~~
roads.cpp:57:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |   if (L == C.size() + 1) {return query2(1, C.size());}
      |       ~~^~~~~~~~~~~~~~~
roads.cpp: In function 'DS* DFS(int, int)':
roads.cpp:89:36: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   89 |   while (child[0].fst -> DP.size() < deg) child[0].fst -> DP.push_back({0, 0});
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
roads.cpp:100:49: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  100 |    for (; jj >= 0 && child[jj].fst -> DP.size() <= i; jj--)
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
roads.cpp:121:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  121 |    for (j = 0; j < V.size(); j++)
      |                ~~^~~~~~~~~~
roads.cpp:130:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  130 |    for (j = 0; j < V.size(); j++)
      |                ~~^~~~~~~~~~
roads.cpp:139:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<DS*, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  139 |   for (int j = 1; j < child.size(); j++)
      |                   ~~^~~~~~~~~~~~~~
roads.cpp:141:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  141 |    for (int k = deg; k < child[j].fst -> DP.size(); k++)
      |                      ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:170:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  170 |  for (int i = 0; i < ans -> DP.size(); 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...