제출 #333874

#제출 시각아이디문제언어결과실행 시간메모리
333874nicholask모임들 (IOI18_meetings)C++14
컴파일 에러
0 ms0 KiB
#incude "meetings.h" #include <bits/stdc++.h> using namespace std; vector <long long> minimum_costs(vector <int> h,vector <int> l,vector <int> r){ int n=h.size(),q=l.size(); vector <long long> res(q); int dist[n][n]; for (int i=0; i<n; i++){ int ma=0; for (int j=i; j>=0; j--){ ma=max(ma,h[j]); dist[i][j]=ma; } ma=0; for (int j=i; j<n; j++){ ma=max(ma,h[j]); dist[i][j]=ma; } } int c[n][n]; for (int i=0; i<n; i++){ c[i][0]=dist[i][0]; for (int j=1; j<n; j++) c[i][j]=c[i][j-1]+dist[i][j]; } for (int i=0; i<q; i++){ int ans=4e18; if (!l[i]){ for (int j=l[i]; j<=r[i]; j++) ans=min(ans,c[j][r[i]]); } else { for (int j=l[i]; j<=r[i]; j++) ans=min(ans,c[j][r[i]]-c[j][l[i]-1]); } res[i]=ans; } return res; }

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

meetings.cpp:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude "meetings.h"
      |  ^~~~~~
      |  include
meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:26:11: warning: overflow in conversion from 'double' to 'int' changes value from '4.0e+18' to '2147483647' [-Woverflow]
   26 |   int ans=4e18;
      |           ^~~~