Codeforces Round #327 (Div. 2)-wizards ' duel

Source: Internet
Author: User

Test instructions

In a corridor of length L, two people stood at the left and right sides of the corridor at the P,q speed, and asked them how far they were from the right side when they met.

Ideas:

Very simple violent problem, not explained.

The code is as follows:

1#include <iostream>2#include <cstdio>3#include <cstring>4#include <fstream>5#include <ctime>6#include <cmath>7#include <cstdlib>8#include <fstream>9 Ten using namespacestd; One  A intMain () - { -     DoubleL, p, Q;//L represents the length of the corridor, P,q respectively stands at the right and left both sides of the speed the      while(SCANF ("%LF%LF%LF", &l, &p, &q) = =3) -     { -printf"%lf\n", l/(P+Q) *p);//the length of the point at which the two people meet (starting at the initial position of p to the length of the meeting point) -     } +  -     return 0; +}

Codeforces Round #327 (Div. 2)-wizards ' duel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.