Search found 68 matches

by yatsen
Fri May 24, 2013 1:09 pm
Forum: Volume 9 (900-999)
Topic: 990 - Diving for Gold
Replies: 11
Views: 5384

Re: 990 - Diving for Gold

I always got WA. What's wrong with my code? Help! //Q990 Diving for gold, #include <cstdio> #include <stack> #include <stdlib.h> #define N 1005 using namespace std; typedef struct node { int d,v; } Treasure; Treasure treasure[32]; int n,dp[N],from[N]; int main() { int t,i,j,k,testcase,w; //freopen("...
by yatsen
Tue Apr 09, 2013 8:55 am
Forum: Volume 110 (11000-11099)
Topic: 11049 - Basic wall maze
Replies: 6
Views: 5121

Re: 11049 - Basic wall maze

Shafaet_du wrote:Sample:

Code: Select all

1 1
6 6
1 2 2 4
5 6 1 6
1 1 2 2
0 0
output:
SSSSSEEEEE
Your input is wrong. The wall should be horizontal or vertical.
by yatsen
Thu Aug 02, 2012 9:36 pm
Forum: Volume 119 (11900-11999)
Topic: 11957 - Checkers
Replies: 4
Views: 1815

Re: 11957 - Checkers

brianfry713 wrote:Line 42 should be if(y-2>=0)
Thank you soooooooo much!
What a stupid mistake I made!
by yatsen
Tue Jul 24, 2012 9:14 am
Forum: Volume 119 (11900-11999)
Topic: 11957 - Checkers
Replies: 4
Views: 1815

Re: 11957 - Checkers

My output is the same as yours.
But WA. why? :(
by yatsen
Sun Jul 08, 2012 7:18 pm
Forum: Volume 119 (11900-11999)
Topic: 11957 - Checkers
Replies: 4
Views: 1815

11957 - Checkers

I got WA for 11957. I use dp. Can anyone help?

Code: Select all

/* Q11957 - Checkers */
cut.... after AC
by yatsen
Mon Dec 19, 2011 3:23 am
Forum: Volume 119 (11900-11999)
Topic: 11968 - In The Airport
Replies: 10
Views: 3674

Re: 11968 - In the Airport

My program got WA, can anyone help me? #include <stdio.h> #include <math.h> int main() { int i,j,testcase,t,n,m,k,ans; long long sum; int cake[1000],drink[1000]; double average,dif,nowdif; /*freopen("in11968.txt","r",stdin);*/ scanf("%d",&testcase); for(t=1; t<=testcase; t++) { scanf("%d %d %d",&n,&...
by yatsen
Mon Nov 21, 2011 7:43 am
Forum: Volume 115 (11500-11599)
Topic: 11579 - Triangle Trouble
Replies: 20
Views: 9889

Re: 11579 - Triangle Trouble

I find what's wrong with my code in the above post. In comp() for qsort(C language) I can not use int comp(double *p,double *q) { return *q-*p; } I should use int comp(double *p,double *q) { if(*q-*p>0) return 1; else if(*q-*p<0) return -1; else return 0; } By the way, I have a wonder: Why can't we ...
by yatsen
Mon Nov 21, 2011 5:09 am
Forum: Volume 115 (11500-11599)
Topic: 11579 - Triangle Trouble
Replies: 20
Views: 9889

Re: 11579 - Triangle Trouble

I got a lot of WA, what's wrong with my code, anyone help?

Code: Select all

int comp(double *p,double *q)
{
    return *q-*p;   
}

.
.
.

ac , removed
by yatsen
Fri Oct 28, 2011 11:19 am
Forum: Volume 118 (11800-11899)
Topic: 11816 - HST
Replies: 1
Views: 1894

11816 - HST

I got WA for this problem.
Can anyone post some test data? Thanks.
by yatsen
Thu Oct 20, 2011 5:10 am
Forum: Volume 102 (10200-10299)
Topic: 10250 - The Other Two Trees
Replies: 6
Views: 4488

Re: 10250 - The Other Two Trees

Can anyone who got AC post some sample I/O?
I always got WA. :(
by yatsen
Wed Apr 06, 2011 5:24 pm
Forum: Volume 118 (11800-11899)
Topic: 11818 - Mouse & a Cheese
Replies: 7
Views: 2636

11818 - Mouse & a Cheese

How to solve this problem?
by yatsen
Mon Dec 13, 2010 9:39 am
Forum: Volume 118 (11800-11899)
Topic: 11878 - Homework Checker
Replies: 23
Views: 8298

Re: 11878 - Homework Checker

I have found what's wrong.
The main program should end with : rturn 0, else it will cause a runtime wrror.
by yatsen
Sat Dec 11, 2010 12:49 pm
Forum: Volume 118 (11800-11899)
Topic: 11843 - Guessing Game
Replies: 10
Views: 3660

Re: 11843 - Guessing Game

Can someone put more test input and output?
by yatsen
Wed Dec 01, 2010 6:21 pm
Forum: Volume 118 (11800-11899)
Topic: 11878 - Homework Checker
Replies: 23
Views: 8298

Re: 11878 - Homework Checker

The following is my code:

Code: Select all

/*11878 - Homework Checker*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
	int ans=0,i,j,a,b,c,k,plus,minus;
	char s[1000],t[30];
	while(scanf("%s",s)==1)
	{
		
		
		/* AC, cut..... */
	}
	printf("%d\n",ans);
}

by yatsen
Wed Dec 01, 2010 9:34 am
Forum: Volume 118 (11800-11899)
Topic: 11878 - Homework Checker
Replies: 23
Views: 8298

11878 - Homework Checker

I always got "Runtime Error".
What's wrong? It seem not a diffcult problem. :(
Can anyone help?

Go to advanced search