Search found 18 matches

by boatfish
Fri Jan 02, 2004 9:32 am
Forum: Volume 8 (800-899)
Topic: 834 - Continued Fractions
Replies: 20
Views: 22486

Observer wrote:I've just solved this problem. I note that there are NO negative numbers in the input! So don't worry about that.
Then why I keep on WA?
by boatfish
Sat Nov 01, 2003 9:00 am
Forum: Volume 8 (800-899)
Topic: 834 - Continued Fractions
Replies: 20
Views: 22486

Hi, I have handled that, but still WA. Why?
[cpp]#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

int main(){
int a,b;
float t;
while(cin>>a>>b){
t=a/float(b);
if(t>=0){
cout<<'['<<a/b<<';';
a=a-a/b*b;
}
else{
cout<<'['<<a/b-1<<';';
a=fabs(b)-(fabs(a)-fabs(a/b ...
by boatfish
Sat Nov 01, 2003 8:52 am
Forum: Volume 7 (700-799)
Topic: 765 - References
Replies: 7
Views: 4901

765 WA!

Any tricky testcases in this problem?
I think I have though about everything about it.
[cpp]#include<iostream>
#include<string>
#include<algorithm>
#include<memory.h>
using namespace std;

struct src{
int no;
string ref;
};

src ref[1000];
int ref_no[1000];
string reg[40000];
int ref_count=0,reg ...
by boatfish
Fri Oct 03, 2003 3:25 pm
Forum: Volume 1 (100-199)
Topic: 123 - Searching Quickly
Replies: 55
Views: 12684

Thx very much.
I have solved it!
by boatfish
Fri Sep 12, 2003 10:41 am
Forum: Volume 1 (100-199)
Topic: 123 - Searching Quickly
Replies: 55
Views: 12684

123 why WA?

Here is my source code, I can't figure out why it keeps on WA.
[cpp]#include<iostream>
#include<string>
#include<set>
#include<algorithm>
using namespace std;

struct srt{
string key;
int start;
string title;
};

srt table[3001];
set<string> ignore;

bool new_less(srt a,srt b){
return a.key<b ...
by boatfish
Wed Sep 10, 2003 2:34 pm
Forum: Volume 4 (400-499)
Topic: 428 - Swamp County Roofs
Replies: 7
Views: 4461

Why WA for 428?

This is really a simple question, but I keep getting WA.
Here is my code, what's wrong?
[cpp]#include<iostream>
#include<math.h>
using namespace std;

long double pi=2*acos(0);

long double roof(long double base,long double ridge,long double between){
return (base+ridge)*between/2;
}

int main ...
by boatfish
Wed Sep 10, 2003 2:04 pm
Forum: Volume 103 (10300-10399)
Topic: 10377 - Maze Traversal
Replies: 26
Views: 14608

Thx very much!
I got AC.
by boatfish
Sun Sep 07, 2003 8:56 am
Forum: Volume 103 (10300-10399)
Topic: 10377 - Maze Traversal
Replies: 26
Views: 14608

10377 why wrong answer?

I have considered all the possibilities that I can think about, but still WA.
#include<iostream>
using namespace std;

char table[61][61];
enum oreo{N,E,S,W};

int main(){
int case_no,r,c,i,j,x,y;
char bu;
oreo ori;
cin>>case_no;
while(case_no--){
cin>>r>>c;
cin.get(bu);
for(i=1;i<=r;i ...
by boatfish
Sat Sep 06, 2003 4:41 pm
Forum: Volume 3 (300-399)
Topic: 384 - Slurpys
Replies: 8
Views: 3027

384 - Slurpys

I have tried all cases that I can think about, who can give me more testcases?
this is my code:
[cpp]#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

string reverse(string t){
int length=t.length(),i;
for(i=0;i<length/2;i++)
swap(t ,t[length-1-i]);
return t;
}

bool ...
by boatfish
Sat Sep 06, 2003 3:14 pm
Forum: Volume 4 (400-499)
Topic: 426 - Fifth Bank of Swamp County
Replies: 14
Views: 3889

Why this code always give me Runtime Error for 426?

I have tried many times, it always gave me:
Your program has died with signal 11 (SIGSEGV). Meaning:
Invalid memory reference
Why??
[cpp]#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;

struct src{
string date;
int check;
double money;
bool star ...
by boatfish
Tue Sep 02, 2003 12:39 pm
Forum: Volume 5 (500-599)
Topic: 567 - Risk
Replies: 46
Views: 25908

567

I tested many cases, all are right.
But it keeps on WA.
[cpp]#include<iostream>
using namespace std;

int table[21][21];

void fw(){
int i,j,k;
for(k=1;k<=20;k++)
for(i=1;i<=20;i++)
for(j=1;j<=20;j++)
if(table [k]+table[k][j]<table [j])
table [j]=table [k]+table[k][j];
}

int main(){
int i,no ...
by boatfish
Sun Aug 31, 2003 1:52 pm
Forum: Volume 5 (500-599)
Topic: 516 - Prime Land
Replies: 23
Views: 9359

516 keep on WA

I really don't know why this code keeps on WA.
It passes all test cases that I can think about.
[cpp]#include<iostream>
#include<string>
#include<math.h>
using namespace std;

struct src{
int p;
int e;
};
src table[32768];

void factor(int result){
int limit=sqrt(result),no=0,i,t=0;
for(i=2;i ...
by boatfish
Sat Jul 12, 2003 3:43 pm
Forum: Volume 8 (800-899)
Topic: 834 - Continued Fractions
Replies: 20
Views: 22486

834 - Continued Fractions

I have considered the cases for negative numbers, but still WA. why??

#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

int main(){
int a,b;
float t;
bool set;
while(cin>>a>>b){
set=false;
t=a/float(b);
if(t>=0){
cout<<'['<<a/b<<';';
a=a-a/b*b;
}
else{
cout ...
by boatfish
Sat Jul 12, 2003 3:33 pm
Forum: Volume 103 (10300-10399)
Topic: 10305 - Ordering Tasks
Replies: 59
Views: 31580

10305 WA why?

I just use topological sort, but keep on WA, why??

[cpp]
#include<iostream>
#include<queue>
#include<memory.h>
#include<algorithm>
using namespace std;

struct src{
int no;
int f;
};

bool graph[101][101];
int pre[101],color[101],t;
src f_c[101];

void DFS_VISIT(int u,int n){
int j;
color =2 ...
by boatfish
Fri Jul 11, 2003 11:05 am
Forum: Volume 104 (10400-10499)
Topic: 10415 - Eb Alto Saxophone Player
Replies: 21
Views: 8975

10415

For the sample input : cdefgab
why the output is 0 1 1 1 0 0 1 1 1 1.

Because in the first note, finger 2~4, 7~10 were used; then in 2nd note(d), no finger was used; in 3rd note e, finger 2~4, 7, 8 were used. So why finger 2 is used only once?

Go to advanced search