# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697194 | _martynas | Toll (BOI17_toll) | C++11 | 95 ms | 17784 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 vi = vector<int>;
struct Edge {
int v, w;
};
const int MXN = 5e4+5;
const int INF = 1e9;
int k, n, m, o;
// [a][b][c] = from a move 2^b blocks ahead to position = c (mod k)
int jump[MXN][16][5];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> k >> n >> m >> o;
for(int a = 0; a < n; a++)
for(int b = 0; b < 16; b++)
for(int c = 0; c < 5; c++)
jump[a][b][c] = INF;
for(int i = 0; i < m; i++) {
int u, v, w; cin >> u >> v >> w;
jump[u][0][v%k] = w;
}
# | 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... |