제출 #634101

#제출 시각아이디문제언어결과실행 시간메모리
634101Jovan26메기 농장 (IOI22_fish)C++17
3 / 100
88 ms7276 KiB
#include<bits/stdc++.h> using namespace std; long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w){ long long rez = 0; bool s1 = true; bool s2 = true; for(int i=0;i<x.size();i++){ if(x[i]%2==1) s1 = false; if(x[i]>1) s2 = false; } if(s1) for(int i=0;i<w.size();i++) rez+=w[i]; if(s2){ long long m1 = 0; long long m2 = 0; for(int i=0;i<w.size();i++){ if(x[i]==0) m1+=w[i]; else m2+=w[i]; } rez=max(m1,m2); } return rez; }

컴파일 시 표준 에러 (stderr) 메시지

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:7:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for(int i=0;i<x.size();i++){
      |              ~^~~~~~~~~
fish.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i=0;i<w.size();i++) rez+=w[i];
      |              ~^~~~~~~~~
fish.cpp:16:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |   for(int i=0;i<w.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...
#Verdict Execution timeMemoryGrader output
Fetching results...