Submission #983216

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9832162024-05-15 09:32:51PanosPaskBitaro’s Party (JOI18_bitaro)C++14
0 / 100
3 ms704 KiB
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef pair<int, int> pi;
int CUTOFF;
int N, M, Q;
vector<vector<int>> adj_list;
vector<vector<pi>> dist;
vector<bool> banned;
// Only for local use in merge
// Make sure to reset after
vector<bool> used;
void push(vector<pi>& v, pi p, int m)
{
if (used[p.second]) {
return;
}
v.pb({p.first + m, p.second});
used[p.second] = true;
}
// a is the list we want to update
// b is from a neighbour,therefore everything +1
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'void merge(std::vector<std::pair<int, int> >&, std::vector<std::pair<int, int> >&)':
bitaro.cpp:36: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]
   36 |     while (a_p < a.size() && b_p < b.size() && c.size() < CUTOFF) {
      |            ~~~~^~~~~~~~~~
bitaro.cpp:36:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     while (a_p < a.size() && b_p < b.size() && c.size() < CUTOFF) {
      |                              ~~~~^~~~~~~~~~
bitaro.cpp:36:57: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     while (a_p < a.size() && b_p < b.size() && c.size() < CUTOFF) {
      |                                                ~~~~~~~~~^~~~~~~~
bitaro.cpp:46:21: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   46 |     while (c.size() < CUTOFF && a_p < a.size()) {
      |            ~~~~~~~~~^~~~~~~~
bitaro.cpp:46:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |     while (c.size() < CUTOFF && a_p < a.size()) {
      |                                 ~~~~^~~~~~~~~~
bitaro.cpp:50:21: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   50 |     while (c.size() < CUTOFF && b_p < b.size()) {
      |            ~~~~~~~~~^~~~~~~~
bitaro.cpp:50:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     while (c.size() < CUTOFF && b_p < b.size()) {
      |                                 ~~~~^~~~~~~~~~
bitaro.cpp:56:16: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   56 |     for (auto& [v, i] : a) {
      |                ^
bitaro.cpp: In function 'int choose_from_calced(int)':
bitaro.cpp:82:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   82 |     for (auto [s, v] : dist[t]) {
      |               ^
bitaro.cpp: In function 'int main()':
bitaro.cpp:111:28: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  111 |         if (dist[i].size() < CUTOFF) {
      |             ~~~~~~~~~~~~~~~^~~~~~~~
bitaro.cpp:93:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   93 |     scanf("%d %d %d", &N, &M, &Q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bitaro.cpp:104:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  104 |         scanf("%d %d", &u, &v);
      |         ~~~~~^~~~~~~~~~~~~~~~~
bitaro.cpp:122:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  122 |         scanf("%d %d", &T, &Y);
      |         ~~~~~^~~~~~~~~~~~~~~~~
bitaro.cpp:127:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  127 |             scanf("%d", &c[i]);
      |             ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...