# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
539033 | timreizin | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 1 ms | 300 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 <iostream>
#include <vector>
#include <algorithm>
#include <deque>
using namespace std;
const int INF = 1e9;
int main()
{
int n, m;
cin >> n >> m;
vector<pair<int, int>> doges(m);
for (auto &[b, p] : doges) cin >> b >> p;
const int D = 180;
vector<vector<int>> dp(n, vector<int>(D, 1e9));
vector<vector<int>> canGet(n);
for (auto &[b, p] : doges) if (p >= D) for (int i = b % p; i < n; i += p) canGet[i].push_back(p);
for (int i = 0; i < n; ++i)
{
sort(canGet.begin(), canGet.end());
canGet.erase(unique(canGet.begin(), canGet.end()), canGet.end());
for (int j = 0; j < canGet.size(); ++j) dp[i].push_back(1e9);
}
return 0;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |