Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define Inf 1000*1000*1000
- #include <vector>
- #include <iostream>
- using namespace std;
- vector <vector <pair<int, int>>> line;
- vector <int> timer, answer;
- vector <bool> used;
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- #endif // !ONLINE_JUDGE
- int N, M, ans = 0;
- scanf("%d %d", &N, &M);
- line.resize(N + 1, vector<pair<int, int>>(N + 1, pair<int, int> (-1, -1)));
- timer.resize(N + 1, 0);
- answer.resize(N + 1, 0);
- used.resize(N + 1, false);
- int a, b, c;
- long long d;
- for (int i = 1; i <= M; i++)
- {
- scanf("%d %d %d %lli", &a, &b, &c, &d);
- d -= 3'000'000;
- if (d < 100) continue;
- d /= 100;
- line[a][b] = make_pair(c, d);
- line[b][a] = make_pair(c, d);
- }
- timer[1] = answer[1] = 0;
- used[1] = true;
- for (int i = 0; i <= N; i++)
- {
- int cur = 0;
- for (int j = 0; j <= N; j++)
- if (!used[j] && (cur == 0 || answer[j] < answer[cur]))
- cur = j;
- if (answer[cur] == Inf)
- break;
- used[cur] = true;
- for (int j = 1; j <= N; j++)
- {
- int t = line[cur][j].first, p = line[cur][j].second;
- if (timer[j] + t < 1440 && )
- j++;
- }
- }
- printf("%d", ans);
- return 0;
- }
- // for (int j = 1; j <= N; j++)
- // {
- // int way = line[min_ind][j];
- // if (answer[min_ind] + way < answer[j] && way != -1)
- // {
- // answer[j] = answer[min_ind] + way;
- // }
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement