# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
252752 | Vladikus004 | Go (COCI18_go) | C++14 | 1 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
const int M = 100 + 3, T = 2000 + 3, N = 1000 + 3;
int n, k, m, a[M], b[M], t[M], ind;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif // LOCAL
cin >> n >> k >> m;
ind = -1;
for (int i = 0; i < m; i++){
cin >> a[i] >> b[i] >> t[i];
if (a[i] > k && ind == -1) ind = i;
}
int IND = ind;
--ind;
int sum = 0, mx = 0;
while (ind >= 0){
if (t[ind] > k - a[ind]) sum += b[ind];
int now = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |