Search found 5 matches

by amstex
Sat Feb 28, 2004 7:21 am
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 70332

I also got WA but don't know why. Here is my code:

#include <iostream>

int main() {
int pos, x, num, sum, result, avg, arr[1000], rem;
double temp;
cin>>num;

while (num!=0) {
pos = 0; sum = 0; result = 0;
for (x = 0; x<num; x++) {
cin>>temp; temp*=100;
arr[pos] = (int)temp;
sum += arr ...
by amstex
Sat Feb 21, 2004 5:14 pm
Forum: Volume 7 (700-799)
Topic: 757 - Gone Fishing
Replies: 6
Views: 4385

757 runtime error

Hi,
I used DP to solve this problem but I got Runtime Error. Would anyone give some test cases for me to debug? Thank you.
by amstex
Thu Aug 14, 2003 6:53 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65402

Hi, my code give the same output as yours.
by amstex
Fri Aug 01, 2003 8:28 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65402

I believe I have considered this because when there are more than one way to go to a point(have the same weight), I always choose the one with minimum Lexicographical order by tracking back. May be this procedure is wrong but I still can not find where.
Thank you for your reply.
by amstex
Tue Jul 29, 2003 10:37 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65402

116 WA help

I have read through 13 pages about pb 116 and tried many test cases but I still can not figure out what's wrong with my code. Would anyone give me some test cases so that I can find what's wrong. Here is my source code. Thank you very much.

#include <stdio.h>

int arr[11][101], cost[11][101], path ...

Go to advanced search