Incidentally, I'm having problems with mine too, of the more ineffable variety. It passes all the tests I throw at it, but I still get WA. Any help would be much appreciated:
/* @JUDGE_ID: 36781AT 10137 C++ */
#include <iostream>
using namespace std;
int min(int num1, int num2) {
if (num1 < num2 ...
Search found 2 matches
- Wed Oct 08, 2003 3:53 am
- Forum: Volume 101 (10100-10199)
- Topic: 10137 - The Trip
- Replies: 159
- Views: 70332
- Wed Oct 08, 2003 12:29 am
- Forum: Volume 101 (10100-10199)
- Topic: 10137 - The Trip
- Replies: 159
- Views: 70332
The problem lies in the fact that you can be one penny off. So where you do
ans += trip[i] - avg;
You're only measuring the distance from those people who spent more than the average. In fact, those people who spent *less* might be closer, and in this case, they are. You need to compute both the ...
ans += trip[i] - avg;
You're only measuring the distance from those people who spent more than the average. In fact, those people who spent *less* might be closer, and in this case, they are. You need to compute both the ...