# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
603032 | Fidan | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 281 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;
typedef long long ll;
const ll inf=(1e9)+10;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n, m, i, j;
cin>>n>>m;
vector<ll> p(m);
vector<ll> b(m);
vector<ll> g(n, -1);
for(i=0; i<m; i++){
cin>>b[i]>>p[i];
g[b[i]]=i;
}
vector<vector<pair<ll, ll>>> v(n);
for(i=0; i<m; i++){
for(j=b[i]%p[i]; j<n; j+=p[i]){
if(g[j]==-1 || i==j) continue;
v[b[i]].push_back({j, (abs(b[i]-j))/p[i]});
}
}
vector<ll> dp(n, inf);
set<pair<ll, ll>> s;
dp[b[0]]=0;
# | 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... |