제출 #954892

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9548922024-03-28 19:03:35colossal_pepeJakarta Skyscrapers (APIO15_skyscraper)C++17
36 / 100
1039 ms3932 KiB
#include <iostream>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;
const int INF = 1e9;
const int BLK = 200;
int n, m;
vector<int> b, p;
vector<vector<int>> v;
int f(int x, int c, int y) {
return x + c * y;
}
void addDoge(int i, int pos, int d, vector<vector<int>> &dist, priority_queue<tuple<int, int, int>> &q) {
if (p[i] < BLK) {
dist[pos][p[i]] = min(dist[pos][p[i]], -d);
q.push(make_tuple(d, pos, p[i]));
} else {
int l = b[i] - p[i], r = b[i] + p[i], x = 1;
while (l >= 0 or r < n) {
if (l >= 0) {
dist[l][0] = min(dist[l][0], -d + x);
q.push(make_tuple(d - x, l, 0));
}
if (r < n) {
dist[r][0] = min(dist[r][0], -d + x);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...