# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250368 | AmirElarbi | Semiexpress (JOI17_semiexpress) | C++14 | 1048 ms | 360 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.
// mainn.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
//
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vl vector<long>
#define pb push_back
int main()
{
int n, m, k;
cin >> n >> m >> k;
int a, b, c;
cin >> a >> b >> c;
int T;
vector<int> s;
cin >> T;
for (int i = 0; i < m; i++)
{
int si;
cin >> si;
s.push_back(si);
}
vector<int> ks;
for (int i = 0; i < m; i++) {
ks.push_back(s[i]);
}
int ans = 0;
for(int l = 2; l < n; l++){
for (int r = l+1; r < n; r++) {
vector<int> test = ks;
test.push_back(l);
test.push_back(r);
sort(test.begin(), test.end());
int res = 0;
for (int stion = 2; stion <= n; stion++) {
int time = 0;
int current = 1;
int i = 1;
int j = 1;
while (current != stion) {
while (current >= s[i] && i < s.size()) i++;
while (current >= test[j] && j < test.size()) j++;
if (s[i] <= stion && current == s[(int)i - 1] && i < s.size()) {
time += (s[i] - current) * b;
current = s[i];
i++;
}
else if (test[j] <= stion && current == test[j - 1] && j < test.size()) {
time += (test[j] - current) * c;
current = test[j];
j++;
}
else if (current) {
time += a;
current++;
}
}
if (time <= T) res++;
}
ans = max(ans, res);
}
}
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |