Showing posts with label Program. Show all posts
Showing posts with label Program. Show all posts

Tuesday, 7 April 2009

Dream Far Away

Didn't do well in this monthly exam.Got the 7th in class,and the 215th in grade.
It seems that my Core-i7 is far away......
Why..
I should have only worked out the second computing problem in the Mathematic Exam.Then the 12 points bonus will lead me to 140+- and I would get what I want...
Life is struggle,truely?
Then what can I do,what should I do,give up programming?
Why so few choices.
It's NOT FAIR...

Saturday, 21 February 2009

Iron Chain Solved

I found that yesterday I forgot the theorem of kinetic energy when I was discussing this problem with CPY this morning.
Yeah,I just got an Accepted on this problem.I want to share my thoughts with all of you~~
I suppose you know that using the theorem of kinetic energy you can get the relation between velocity and displacement:
v=[2*g*x*(b-a+x)/(a+b)]^-1
P.S.:x is the displacement of one end of the iron chain.
So,we can suppose that the velocity in a VERY LITTILE displacement is increasing at a constant speed,then we can figure out the time the chain spent passing this VERY LITTLE displacement,then add the time the iron chain straightly falling down,and we will have some code like this bellow:

Then you can output the variable time as answer~

I am only a high school student in China,and I know my English isn't very well...
Hope this post useful to you,and hope you can understand my meaning..
HEHE~

Friday, 20 February 2009

Iron Chain

A problem from an online judge system:

In physics class, the teacher shows us an interesting physics experiment. He hangs an iron chain on a fixed point on the wall. (Look at the right picture for more details). If the lengths of the iron chains on the left side and right side are different, the gravity forces the iron chain to drop to the floor and hits the sensor. Then the computer shows the F-t functional image on the screen. The teacher wants to teach you momentum and its conservation.

But you are not interested in this at all. The thing you want to know is how long it takes for the iron chain to drop to the floor.

You can assume that the iron chain is well-mixed, and you can ignore the friction between the iron chain and the fixed point on the wall. The friction between the chain and the air needn’t be taken into account either. The fixed point is a particle whose radius is 0. And the acceleration of gravity, or so-called g, is 9.80665m/s^2 in this problem.

Example:
1.Input: a=0 ,b=10,h=20
Output: t=1.428s
2.Input: a=1,b=3,h=4
Output: t=0.595s

============Cut-Off Rule===========
I've tried the approximation algorithm.But I couldn't pass through the judge.[I've passed the Examples before.]
And I communicated with CPY about using Calculus to solve this problem,but we couldn't solve the equation.
Who can help me....

Friday, 23 January 2009

First Time APM 100+ In War3


Just now played a round Chenghai with my classmate Qin Zihao,I chose BM as my first hero,then BMG,then Lich,and I found my APM is 136.99,maximum over 220!(We didn't finish this game because his mother is angry with him~I have got a little advantage over him)
A great progress.
This morning I installed the S60_2nd(8.0a) SDK and Visual C++ 6.0,and successfully built the HelloWorldBasic example program.

Tuesday, 6 January 2009

A+B Program In C++


Faint.
Don't know how to compile a simple console c++ source file in Eclipse and Anjuta.
Thanks to Yizer.He suggested me to use the Code::Blocks IDE,and it really works--successfully compiled and run the 'famous' A+B program.HEHE~