A. Key races

水题,因为英文不好就变成要费劲思考的题了(思考样例分别怎么算的…)
Two boys decided to compete in text typing on the site “Key races”. During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The second participant types one character in v2 milliseconds and has ping t2 milliseconds.

If connection ping (delay) is t milliseconds, the competition passes for a participant as follows:

Exactly after t milliseconds after the start of the competition the participant receives the text to be entered.
Right after that he starts to type it.
Exactly t milliseconds after he ends typing all the text, the site receives information about it.
The winner is the participant whose information on the success comes earlier. If the information comes from both participants at the same time, it is considered that there is a draw.

Given the length of the text and the information about participants, determine the result of the game.

Input
The first line contains five integers s, v1, v2, t1, t2 (1 ≤ s, v1, v2, t1, t2 ≤ 1000) — the number of characters in the text, the time of typing one character for the first participant, the time of typing one character for the the second participant, the ping of the first participant and the ping of the second participant.

Output
If the first participant wins, print “First”. If the second participant wins, print “Second”. In case of a draw print “Friendship”.
Examples
inputCopy
5 1 2 1 2
outputCopy
First
inputCopy
3 3 1 1 1
outputCopy
Second
inputCopy
4 5 3 1 5
outputCopy
Friendship
Note
In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant — in 14 milliseconds. So, the first wins.

In the second example, information on the success of the first participant comes in 11 milliseconds, of the second participant — in 5 milliseconds. So, the second wins.

In the third example, information on the success of the first participant comes in 22 milliseconds, of the second participant — in 22 milliseconds. So, it is be a draw.
大意:俩人比赛(网络有延迟)时间为各自的 t ,t 的意思(比赛开始计时,t毫秒后才收到题目,打完字后立刻上交, t 毫秒后裁判才收到你的提交)
比赛给出 s 个字符,第一个人打一个字符用 v1 毫秒,第二个人…
注意:是打一个字用 v 毫秒,不是1毫秒能打 v 个字!!!

#include <iostream>
using namespace std;

int main()
{
    int s, v1, v2, t1, t2;
    while(cin >> s >> v1 >> v2 >> t1 >> t2)
    {
        int sum1 = 2 * t1 + s * v1;
        int sum2 = 2 * t2 + s * v2;
        if(sum1 < sum2)
            cout << "First" << '\n';
        else if(sum1 > sum2)
            cout << "Second" << '\n';
        else
            cout << "Friendship" << '\n';
    }
    return 0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
蕴瑜课堂大学英语(四) unit 2 customs 第二章测试答案如下: 第一部分:听力(共20分) 1. B 2. C 3. A 4. B 5. C 6. C 7. A 8. C 9. B 10. A 第二部分:语言知识运用(共30分) 11. B 12. A 13. C 14. B 15. C 16. A 17. C 18. B 19. A 20. B 21. C 22. A 23. B 24. C 25. A 第三部分:阅读理解(共40分) 26. D 27. A 28. C 29. B 30. C 31. D 32. B 33. A 34. D 35. A 36. C 37. B 38. D 39. C 40. A 第四部分:写作(共10分) One possible version: Customs are a fascinating aspect of different countries and cultures. They reflect the values, traditions, and behaviors that are important to a particular group of people. In my country, China, customs play a significant role in our daily lives. For example, the Spring Festival is our most important traditional holiday. During this time, families gather together to celebrate and show respect to our ancestors. We also give red envelopes with money to children and cook special dishes for the occasion. Another important custom is the Dragon Boat Festival, where we eat sticky rice dumplings and watch dragon boat races. In contrast, the customs in Western countries may vary greatly. For instance, Christmas is a major holiday in many Western countries. It is celebrated on December 25th and involves decorating trees, giving gifts, and sharing meals with loved ones. Halloween is also a widely celebrated custom in Western countries, where people dress up in costumes, go trick-or-treating, and carve pumpkins. Understanding and respecting customs is essential when visiting or interacting with people from different cultures. It allows us to appreciate the diversity and uniqueness of different customs and enhances cultural understanding and cooperation.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值