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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
ifstream in;
int N;
int a,b,w;
int points[100][100];
int priorityQ[100][100];
int firstCords[6];
int secondCords[6];
int firstCo;
int secondCo;
int incrementCo;
int dist;
int first;
int second;
void init(){
in >> N;
first = 2;
second = 3;
firstCo = 0;
secondCo = 0;
incrementCo = 0;
while(in){
in >> a >> b >> w;
points[a][b] = w;
}
for(int i = 0; i < 6; i++){
firstCords[i] = 0;
secondCords[i] = 0;
}
dist = 0;
}
void swap(int first,int second){
int temp;
}
bool isValidPoint(int first,int second){
if(points[first][second] != 0){
return true;
}
return false;
}
void copyAndRemove(int first,int second){
}
int findShortest(int first,int second,int *ina,int *inb,int amount){
int shortest = inb[0];
for(int i = second+1; i < amount; i++){
if(points[0][0] < points[0][0]){
}
return shortest;
}
}
void compare()
{
int amount = 0;
int incrementCords = 0;
while(true)
{
while(true)
{
for(int i = 0; i < 6; i++){
if(isValidPoint(first,second)){
firstCords[incrementCords] = first;
// secondCords[incrementCords] = 0;
incrementCords++;
amount++;
}
second++;
}
// int shortest = findShortest(first,0,firstCords,secondCords,amount);
// here
}
if(first == N){
cout << "you have reached the destination" << endl;
break;
}
first++;
}
}
int main()
{
in.open("dist.txt");
init();
compare();
cout << dist << endl;
}
|