제출 #760365

#제출 시각아이디문제언어결과실행 시간메모리
760365sheldonJakarta Skyscrapers (APIO15_skyscraper)C++14
0 / 100
2 ms3124 KiB
#include <bits/stdc++.h> using namespace std; const int nax = 3e4 + 5; vector<pair<int, int>> doges[nax]; set<int> s[nax]; bool visited[nax]; vector<int> edges[nax]; void solve () { int n, m; cin >> n >> m; for (int i = 0; i < m; ++i) { int b, p; cin >> b >> p; doges[b].push_back({i, p}); s[b].insert(p); } for (int i = 0; i < n; ++i) { auto it = s[i].begin(); while (it != s[i].end()) { int x = *it; for (int j = i + x; j < n; j += x) { edges[j - x].push_back(j); s[j].erase(x); } it = s[i].erase(it); } } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...