# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953962 | JooDdae | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 335 ms | 262144 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>
using namespace std;
using ll = long long;
const ll INF = 1e18;
int n, m, s[30030], p[30030];
ll d[30030];
vector<array<int, 2>> v[30030];
set<int> st[30030];
priority_queue<array<ll, 2>> pq;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
for(int i=1;i<=m;i++) {
cin >> s[i] >> p[i];
st[s[i]].insert(p[i]);
}
for(int i=1;i<=m;i++) {
for(int j=1;;j++) {
int x = s[i]-p[i]*j;
if(x < 0) break;
v[s[i]].push_back({x, j});
if(st[x].count(p[i])) break;
}
for(int j=1;;j++) {
int x = s[i]+p[i]*j;
if(x >= n) break;
v[s[i]].push_back({x, j});
# | 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... |