10947 - Bear with me, again..

All about problems in Volume 109. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

New poster
Posts: 22
Joined: Thu Apr 28, 2005 10:56 pm

Post by Tamagodzi »

Thnx mjf ...

0.150 seconds after that without using optimized io :-)

Official solution uses a non-logical algorithm, that says that you can't go from one island to another if they overlap. We're going to change the input, so that no 2 islands intersect.

And a negative island number is logical? ...

0.123 after switching to scanf/printf from cin cout ^^
Last edited by Tamagodzi on Sat Oct 22, 2005 4:31 pm, edited 1 time in total.

little joey
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey »

Adrian will probably say something like: SCH3155 D0NN3RW3773R v#RD4MM73 SCHW31N3R31!

Adrian Kuegel
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

little joey wrote:Adrian will probably say something like: SCH3155 D0NN3RW3773R v#RD4MM73 SCHW31N3R31!
Yes, something like that :wink:
Well, I had two "real" WA on that problem anyway, since first I had a bug in my formula.

DongJoo Kim
New poster
Posts: 20
Joined: Tue Sep 20, 2005 9:20 am
Location: Daejeon, Korea

Post by DongJoo Kim »

Somthing funny about this problem is that I actually got ACC before rejudge although I didn't submit the code with wrong formula.

In my code, the distance formula was wrong

it was...

dist = (x1-y1)*(x1-y1) + (x2-y2)*(x2-y2) ;

I have no idea Y I got AC... at that time.

It was very amazing :o

A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post by Per »

little joey wrote:This problem definitly needs re-rejudging (and I want my perfect score 6 AC for 6 submissions for the contest back...).
It seems the problem is rejudged now, there are a lot more people with 6 solved, you being one of them. Still lots of TLEs though, so I guess they still have a lot more I/O than during the actual contest. Oh well.

For some reason they seem to have rejudged F as well, my solution where I accidentally typed "int isprime[10000010];" rather than "int isprime[1000010];" and (rightfully) got MLE has been rejudged to AC. Strange.

Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada

Post by sclo »

I found that after the rejudge, my O(n^3) solution is TLE, but O(n^2) is AC.

New poster
Posts: 1
Joined: Sat May 05, 2012 4:34 pm

10947 - Bear with me, again..

Post by arjun2304 »

Code: Select all


using namespace std;

int xc[110],yc[110],r[110];
double a[110][110];

double min(double x,double y)
       if(x>y)return y;
       return x;
double max(double x,double y)
       if(x>y)return x;
       return y;
double distance(int x1,int y1,int x2,int y2)
       return sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
int main()
    int i,j,n,sx,sy,sr,dx,dy,dr;
    double k,m;
printf("Larry and Ryan will be eaten to death.\n");
printf("Larry and Ryan will escape!\n");
return 0;


Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10947 : wy WA.????

Post by brianfry713 »

Compile Error:

Code: Select all

code.cpp: In function 'int main()':
code.cpp:57:31: error: invalid types 'double [110][double]' for array subscript
code.cpp:57:36: error: invalid types 'double [110][110][double]' for array subscript
Check input and AC output for thousands of problems on uDebug!

Experienced poster
Posts: 145
Joined: Thu Aug 14, 2003 8:42 am
Location: Mountain View, California

Re: 10947 : wy WA.????

Post by DD »

This problem is easy enough so you should not get W.A.
Have you ever...
  • Wanted to work at best companies?
  • Struggled with interview problems that could be solved in 15 minutes?
  • Wished you could study real-world problems?
If so, you need to read Elements of Programming Interviews.

Post Reply

Return to “Volume 109 (10900-10999)”