Can someone please point out why I'm getting WA for this code? It's just a straightforward implementation of Floyd-Warshall...
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
int main()
{
int Case = 0;
while (true)
{
const int MAX = 20;
const int INF ...
Search found 14 matches
- Sat Nov 10, 2007 3:49 pm
- Forum: Volume 5 (500-599)
- Topic: 567 - Risk
- Replies: 46
- Views: 25480
- Thu Aug 09, 2007 11:16 am
- Forum: Volume 111 (11100-11199)
- Topic: 11101 - Mall Mania
- Replies: 25
- Views: 15595
WA
I'm getting WA for my code. Can someone please spot the error...
#include <iostream>
using namespace std;
const int MAX = 10000;
int MallA[MAX][2] = { 0 };
int APoints = 0;
int MallB[MAX][2] = { 0 };
int BPoints = 0;
int GetDist(int X1, int Y1, int X2, int Y2)
{
int Horizontal = Y1 - Y2;
if ...
#include <iostream>
using namespace std;
const int MAX = 10000;
int MallA[MAX][2] = { 0 };
int APoints = 0;
int MallB[MAX][2] = { 0 };
int BPoints = 0;
int GetDist(int X1, int Y1, int X2, int Y2)
{
int Horizontal = Y1 - Y2;
if ...
- Thu Aug 02, 2007 1:57 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10044 - Erdos Numbers
- Replies: 102
- Views: 55231
Runtime Error - Invalid Memory Reference
My program gives Runtime Error - Invalid Memory Reference. I understand this could be because my arrays are going out of bounds some place but I can't spot anything. Someone help please...
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
const int MAX = 6000;
char ...
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
const int MAX = 6000;
char ...
- Sat Feb 17, 2007 8:17 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10137 - The Trip
- Replies: 159
- Views: 70204
goin crazy!
could someone please help me with this code...
#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
float round(float a)
{
char b[128] = { 0 };
sprintf(b, "%.2f", a);
a = atof(b);
return a;
}
int main()
{
int Students = 0;
float Spent[MAX] = { 0.0 };
float Total = 0.0;
float ...
#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
float round(float a)
{
char b[128] = { 0 };
sprintf(b, "%.2f", a);
a = atof(b);
return a;
}
int main()
{
int Students = 0;
float Spent[MAX] = { 0.0 };
float Total = 0.0;
float ...
- Sun Dec 31, 2006 3:47 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10137 - The Trip
- Replies: 159
- Views: 70204
V101 - 10137 - WA
Why is this code WA? It works for all the sample input on this board.
#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
float round(float a)
{
char b[128] = { 0 };
sprintf(b, "%.2f", a);
a = atof(b);
return a;
}
int main()
{
int Students = 0;
float Spent[MAX] = { 0.0 };
float ...
#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
float round(float a)
{
char b[128] = { 0 };
sprintf(b, "%.2f", a);
a = atof(b);
return a;
}
int main()
{
int Students = 0;
float Spent[MAX] = { 0.0 };
float ...
- Sun Dec 24, 2006 10:25 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10222 - Decode the Mad man
- Replies: 30
- Views: 15362
!!!
strange! the first time i tried it gave compile error! thnx for your time nyways!
- Sat Dec 23, 2006 1:12 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10222 - Decode the Mad man
- Replies: 30
- Views: 15362
10222
Can anyone find any error in this code? It compiles fine in gcc but the oj flags compile error: parse error b4 character 0222
AC
AC
- Sat Dec 23, 2006 1:04 pm
- Forum: Volume 5 (500-599)
- Topic: 530 - Binomial Showdown
- Replies: 137
- Views: 49045
WA
can someone please tell me what is wrong with this C code...
#include <stdio.h>
int main()
{
int n = 0;
int r = 0;
unsigned int Result = 1;
double Temp = 1.0;
int i = 0;
while (1)
{
scanf("%d %d", &n, &r);
if (n == 0 && r == 0)
break;
r = n - r < r ? n - r : r;
for (i = r ...
#include <stdio.h>
int main()
{
int n = 0;
int r = 0;
unsigned int Result = 1;
double Temp = 1.0;
int i = 0;
while (1)
{
scanf("%d %d", &n, &r);
if (n == 0 && r == 0)
break;
r = n - r < r ? n - r : r;
for (i = r ...
- Sat Jun 24, 2006 6:26 pm
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies: 270
- Views: 64374
- Fri Jun 23, 2006 1:42 am
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45142
- Thu Jun 22, 2006 9:59 pm
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies: 270
- Views: 64374
- Thu Jun 22, 2006 9:55 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45142
- Thu Jun 22, 2006 11:28 am
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies: 270
- Views: 64374
488 - Triangle Wave
this program seems t conform to all the rules but still gets PE! help!
#include <iostream>
using namespace std;
int main()
{
short a = 0;
short f = 0;
short n = 0;
cin >> n;
while(n)
{
cin >> a;
cin >> f;
for(char i = 1; i <= f; i++)
{
for(char j = 1; j <= a; j++)
{
for(char ...
#include <iostream>
using namespace std;
int main()
{
short a = 0;
short f = 0;
short n = 0;
cin >> n;
while(n)
{
cin >> a;
cin >> f;
for(char i = 1; i <= f; i++)
{
for(char j = 1; j <= a; j++)
{
for(char ...
- Wed Jun 21, 2006 9:17 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45142
160 - RUNTIME ERROR!!
this code works for all test cases on my pc, but with oj it give runtime error floating point exception! somebody please help!
info:
i use sieve of eratosthenes to compute all prime nos >=2 <= 100.
info:
i use sieve of eratosthenes to compute all prime nos >=2 <= 100.
Code: Select all
ACCEPTED!!