# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918922 | jpfr12 | Tarifa (COCI16_tarifa) | C++14 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <string>
#include <map>
#include <math.h>
#include <cmath>
#include <climits>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
#include <fstream>
#include <bitset>
#include <iomanip>
typedef long long ll;
using namespace std;
int MOD = (int)1e9;
int MAXN = 1e6;
//classes
//global
int n, m;
string s;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
//ifstream fin("input.txt");
//ofstream fout("output.txt");
//stop
ll x, n;
cin >> x >> n;
ll cost = x;
for(int i = 0; i < n; i++){
ll num;
cin >> num;
cost = max(0LL, x + (cost-num));
}
cout << cost << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |