a814a54c34
I did not have fun These problems were very unenjoyable imo (skill issue probably)
40 lines
777 B
C++
40 lines
777 B
C++
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
ios::sync_with_stdio(0);
|
|
cin.tie(0);
|
|
|
|
cin.ignore(6);
|
|
string line;
|
|
getline(cin, line);
|
|
istringstream sls(line);
|
|
vector<long> seeds;
|
|
vector<bool> done;
|
|
while (!sls.eof()) {
|
|
long n;
|
|
sls >> n;
|
|
seeds.push_back(n);
|
|
done.push_back(false);
|
|
}
|
|
cin.ignore(1);
|
|
|
|
for (int mapn = 0; mapn < 7; mapn++) {
|
|
cin.ignore(500, '\n');
|
|
while (getline(cin, line) && !line.empty()) {
|
|
istringstream sls(line);
|
|
long d, s, r;
|
|
sls >> d >> s >> r;
|
|
for (int i = 0; i < seeds.size(); i++) {
|
|
if (!done[i] && seeds[i] >= s && seeds[i] < s + r) {
|
|
seeds[i] += d - s;
|
|
done[i] = true;
|
|
}
|
|
}
|
|
}
|
|
fill(done.begin(), done.end(), false);
|
|
}
|
|
|
|
cout << *min_element(seeds.begin(), seeds.end()) << '\n';
|
|
}
|