Submission #1103654

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11036542024-10-21 13:06:51ortsacToll (BOI17_toll)C++17
100 / 100
1590 ms7860 KiB
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define fm first
#define t second
const int MAXN = 5e4 + 10;
const int INF = 0x3f3f3f3f;
vector<pii> rec[MAXN];
int ans[MAXN];
void calc(int a, int b) {
for (int i = max(a - 10, 0); i <= (b + 10); i++) ans[i] = INF;
ans[a] = 0;
for (int i = a + 1; i <= b; i++) {
for (auto u : rec[i]) ans[i] = min(ans[i], ans[u.fm] + u.t);
}
}
int32_t main() {
int k, n, m, o;
cin >> k >> n >> m >> o;
for (int i = 0; i < m; i++) {
int a, b, toll;
cin >> a >> b >> toll;
rec[b].push_back({a, toll});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...