제출 #949561

#제출 시각아이디문제언어결과실행 시간메모리
949561tnunJelly Flavours (IOI20_jelly)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair int find_maximum_unique(int x, int y,vector<int> a,vector<int> b){ sort(a.begin(),a.end()); int ans=0; for(int i=0;i<a.size();i++){ if(x>=a[i]){ x-=a[i]; ans++; } } return ans+y/b[i]; }

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

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:9:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i=0;i<a.size();i++){
      |              ~^~~~~~~~~
jelly.cpp:15:17: error: 'i' was not declared in this scope
   15 |  return ans+y/b[i];
      |                 ^