제출 #98255

#제출 시각아이디문제언어결과실행 시간메모리
98255dalgerokTarifa (COCI16_tarifa)C++17
50 / 50
3 ms384 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int x, n, p; main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin >> x >> n; int ans = 0; for(int i = 1; i <= n; i++){ cin >> p; ans = max(0LL, (ans + x) - p); } cout << ans + x; }

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

tarifa.cpp:10:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...