Submission #444595

#TimeUsernameProblemLanguageResultExecution timeMemory
444595KLPPFountain Parks (IOI21_parks)C++17
5 / 100
81 ms9768 KiB
#include "parks.h" #include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) typedef long long int lld; #define INF 1000000000000000LL vector<pair<int,int> >V; int construct_roads(std::vector<int> x, std::vector<int> y) { rep(i,0,y.size())V.push_back({y[i],i}); sort(V.begin(),V.end()); std::vector<int> u, v, a, b; rep(i,0,V.size()){ if(i<V.size()-1 && V[i].first!=V[i+1].first-2){ return 0; } if(i<V.size()-1){ u.push_back(V[i].second); v.push_back(V[i+1].second); a.push_back(3); b.push_back(V[i].first+1); } } build(u, v, a, b); return 1; }

Compilation message (stderr)

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:5:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(i,a,b) for(int i=a;i<b;i++)
......
   11 |  rep(i,0,y.size())V.push_back({y[i],i});
      |      ~~~~~~~~~~~~                
parks.cpp:11:2: note: in expansion of macro 'rep'
   11 |  rep(i,0,y.size())V.push_back({y[i],i});
      |  ^~~
parks.cpp:5:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(i,a,b) for(int i=a;i<b;i++)
......
   14 |     rep(i,0,V.size()){
      |         ~~~~~~~~~~~~             
parks.cpp:14:5: note: in expansion of macro 'rep'
   14 |     rep(i,0,V.size()){
      |     ^~~
parks.cpp:15:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |   if(i<V.size()-1 && V[i].first!=V[i+1].first-2){
      |      ~^~~~~~~~~~~
parks.cpp:18:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   if(i<V.size()-1){
      |      ~^~~~~~~~~~~
#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...