Search found 8 matches
Search found 8 matches • Page 1 of 1
- Fri Jul 07, 2006 10:49 pm
- Forum: Volume 1 (100-199)
- Topic: 116 - Unidirectional TSP
- Replies: 226
- Views: 37857
This, essentially, is my algorithm: Read data into a matrix (the data matrix) Create another matrix (the sum matrix), the last column of which is copied from the data matrix For each column (except the last) of the data matrix, starting from the last column: For each element of that column: Look at ...
Well, I tried that, and it compiled on both my machine and on the compiler there. However, it said that my program gave the wrong answer, so I try running the program on my computer. The correct output should look like (x - 17.716)^2 + (y - 0.735)^2 = 15.733^2 x^2 + y^2 - 35.433x - 1.470y + 66.865 =...
In one of the files that I've submitted, I wrote ostringstream o; o << fixed << setprecision(3); I made sure to include #include <iomanip> #include <sstream> #include <string> #include <cmath> #include <vector> #include <iostream> using namespace std; And this all worked perfectly fine on my machine...
- Tue May 16, 2006 5:41 pm
- Forum: C++
- Topic: sorting a double Array using <algorithm>
- Replies: 3
- Views: 2128
Check out the usage of sort: (copied from http://www.cppreference.com/cppalgorithm/sort.html): #include <algorithm> void sort( iterator start, iterator end ); void sort( iterator start, iterator end, StrictWeakOrdering cmp ); So you need 2 or 3 arguments after sort, and the first 2 muts be iterators...
- Mon May 15, 2006 8:53 am
- Forum: Bugs and suggestions
- Topic: Bizarre compiler warnings
- Replies: 3
- Views: 2151
I've never had any weird problems getting my submitted code to be compiled, but all the sudden I can't figure out what's going on. My C++ program begins: 1 #include <iterator> 2 #include <ctype.h> 3 #include <iostream> 4 #include <vector> 5 #include <algorithm> 6 7 using namespace std; 8 9 string to...