제출 #170745

#제출 시각아이디문제언어결과실행 시간메모리
170745beksultan04금 캐기 (IZhO14_divide)C++14
48 / 100
1081 ms2396 KiB
#include <bits/stdc++.h> using namespace std; #define fr first #define sc second #define pb push_back #define mk make_pair #define OK puts("OK"); #define sz(s) (int)s.size() #define pii pair<int,int> #define int long long #define all(s) s.begin(), s.end() #define allr(s) s.rbegin(), s.rend() #define rep(i,n) for (i=0;i<(n);++i) #define rep1(i,n) for (i=1;i<=(n);++i) #define ret return #define nemeshay ios::sync_with_stdio(0),cin.tie(0); const int N=1e6+12,INF=1e9+7; int q[N],a[N],b[N],e[N],g[N],x[N]; main(){ nemeshay int n,i,j,k,ans=0; cin>>n; rep1(i,n){ cin>>x[i]>>g[i]>>e[i]; a[i]=a[i-1]+e[i]; b[i]=b[i-1]+g[i]; } for (i=1;i<=n;++i){ for (j=i;j<=n;++j){ int z=x[j]-x[i],c=a[j]-a[i-1]; if (z<=c){ ans=max(ans,b[j]-b[i-1]); } } } cout <<ans; }

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

divide.cpp:19:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
divide.cpp: In function 'int main()':
divide.cpp:21:15: warning: unused variable 'k' [-Wunused-variable]
     int n,i,j,k,ans=0;
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...