@GatorGirl/

AlphanumericTriangularAggregator

C++11

https://www.spoj.com/problems/CSTREET/

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <iostream>
#include <vector>
#include <string>
using namespace std;

/*
Input:
1 num opf testcases
2 price per furlong
5 num of buildings
7 num of streets
1 2 1
2 3 2
2 4 6
5 2 1
5 1 3
4 5 2
3 4 3

Output:
12
*/

class Path
{
  public:
    int a;
    int b;
    int dist;
    bool fringe;
    bool visitA;
    bool visitB;

};

void findPaths(vector<Path> streets, int currBuilding)
{
  for (int i = 0; i < streets; i ++)
  {
    //find all paths that lead to building
  }
}

int main() 
{
  vector<Path> streets;
  int testcases;
  cin >> testcases;
  cout << endl;
  int pricePerFurlong;
  cin >> pricePerFurlong;
  cout << endl;
  int numBuildings;
  cin >> numBuildings;
  cout << endl;
  int numStreets;
  cin >> numStreets;
  cout << endl;
  int a, b, dist;
  Path* temp = new Path();
  for (int i = 0; i < numStreets; i ++)
  {
    cin >> a;
    cin >> b;
    cin >> dist;
    temp->a = a;
    temp->b = b;
    temp->dist = dist;
    temp->fringe = false;
    temp->visitA = false;
    temp->visitB = false;
    streets.push_back(temp);
    cout << endl;
  }
  //start here
  int currBuilding = streets[0]->a;
  streets[0]->visitA = true;
  findPaths(currBuilding);
  return 0;
}