Submission #625773

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6257732022-08-10 18:57:11inwbearCatfish Farm (IOI22_fish)C++17
100 / 100
675 ms100472 KiB
//#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define imx INT_MAX
const long long MMX = (long long)(1e18);
typedef long long LL;
vector<pair<int,LL> > dw[100005],val[100005];
vector<pair<int,pair<int,int> > >up[100005];
vector<pair<LL,int> >lup[100005],ldw[100005],lze[100005];
vector<LL>rup[100005];
int c1,c2,si1,si2,c3,cr,crr;
LL ze[100005],rr,rrdw,rrup,ans;
long long max_weights(int N,int M,vector<int>X,vector<int>Y,vector<int>W){
for(int i=0;i<M;i++){
up[X[i]+2].pb({Y[i]+1,{W[i],-1}});
up[X[i]].pb({Y[i]+1,{W[i],1}});
dw[X[i]].pb({Y[i]+1,W[i]});
val[X[i]+1].pb({Y[i]+1,W[i]});
}
for(int i=1;i<=N;i++){
sort(all(up[i]));
sort(all(dw[i]));
sort(all(val[i]));
}
lze[0].pb({0,0});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:32:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for(int j=0;j<dw[i].size();j++){
      |                 ~^~~~~~~~~~~~~
fish.cpp:39:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |     for(int j=0;j<val[i].size();j++)rrdw+=val[i][j].S;
      |                 ~^~~~~~~~~~~~~~
fish.cpp:68:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |     for(int j=0;j<up[i].size();j++){
      |                 ~^~~~~~~~~~~~~
fish.cpp:70:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   70 |       if(j!=up[i].size()-1){
      |          ~^~~~~~~~~~~~~~~~
fish.cpp:74:12: 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]
   74 |       if(c1!=lup[i-1].size()){
      |          ~~^~~~~~~~~~~~~~~~~
fish.cpp:77:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |           if(c2!=val[i-1].size()){
      |              ~~^~~~~~~~~~~~~~~~~
fish.cpp:81:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   81 |               if(c2==val[i-1].size())break;
      |                  ~~^~~~~~~~~~~~~~~~~
fish.cpp:84:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |           if(c3!=val[i].size()){
      |              ~~^~~~~~~~~~~~~~~
fish.cpp:88:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   88 |               if(c3==val[i].size())break;
      |                  ~~^~~~~~~~~~~~~~~
fish.cpp:94:16: 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]
   94 |           if(c1==lup[i-1].size())break;
      |              ~~^~~~~~~~~~~~~~~~~
fish.cpp:107:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |     for(int j=0;j<val[i-1].size();j++)rrdw-=val[i-1][j].S;
      |                 ~^~~~~~~~~~~~~~~~
fish.cpp:130:18: 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]
  130 |     for(int j=0;j<lup[i].size();j++){
      |                 ~^~~~~~~~~~~~~~
fish.cpp:132:12: 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]
  132 |       if(c1!=lze[i-1].size()){
      |          ~~^~~~~~~~~~~~~~~~~
fish.cpp:135:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  135 |           if(c2!=val[i-1].size()){
      |              ~~^~~~~~~~~~~~~~~~~
fish.cpp:139:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  139 |               if(c2==val[i-1].size())break;
      |                  ~~^~~~~~~~~~~~~~~~~
fish.cpp:144:16: 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]
  144 |           if(c1==lze[i-1].size())break;
      |              ~~^~~~~~~~~~~~~~~~~
fish.cpp:176:18: 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]
  176 |     for(int j=0;j<lup[i].size();j++)ans=max(ans,lup[i][j].F);
      |                 ~^~~~~~~~~~~~~~
fish.cpp:177:18: 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]
  177 |     for(int j=0;j<ldw[i].size();j++)ans=max(ans,ldw[i][j].F);
      |                 ~^~~~~~~~~~~~~~
fish.cpp:178:18: 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]
  178 |     for(int j=0;j<lze[i].size();j++)ans=max(ans,lze[i][j].F);
      |                 ~^~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...