제출 #1040378

#제출 시각아이디문제언어결과실행 시간메모리
1040378vjudge1금 캐기 (IZhO14_divide)C++17
48 / 100
1037 ms5712 KiB
#include <bits/stdc++.h> using namespace std; main() { long long n; cin >> n; long long x[n+1],g[n+1],d[n+1]; for (long long i=1; i<=n; i++) cin >> x[i] >> g[i] >> d[i]; long long res=0; for (long long i=1; i<=n; i++) { long long temp=0,temp2=0; for (long long j=i; j<=n; j++) { temp+=g[j]; temp2+=d[j]; if (x[j]-x[i]<=temp2) res=max(res,temp); } } cout << res; return 0; }

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

divide.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...