zoukankan      html  css  js  c++  java
  • Codeforces Round #427 (Div. 2)

    题目链接:http://codeforces.com/contest/835/problem/A

    题意:两个人给网站发信息,现在给出信息的长度n,两个人的延迟和打字速度(一个字符),问网站先收到哪个人的信息或者同时收到(平局)。对于每个人的流程是:先进行一次延迟,然后开始输入信息,最后再进行一个延迟后网站收到该人所发的信息。

    思路:水题。 按照题意求出两人的所花时间即可

    #define _CRT_SECURE_NO_DEPRECATE
    #include<iostream>
    #include<cstdio>
    #include<cstring>
    #include<algorithm>
    #include<string>
    #include<queue>
    #include<vector>
    #include<time.h>
    #include<cmath>
    #include<set>
    #include<map>
    using namespace std;
    typedef long long int LL;
    const int MAXN = 1e6 + 24;
    const int INF = 1e9;
    const int mod = 1e9 + 7;
    int main(){
    #ifdef kirito
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
        int s,v1,v2,t1,t2;
        while (~scanf("%d%d%d%d%d", &s,&v1,&v2,&t1,&t2)){
            LL res1 = t1 + t1 + 1LL * s*v1;
            LL res2 = t2 + t2 + 1LL * s*v2;
            //printf("%lld %lld
    ", res1, res2);
            if (res1 == res2){
                printf("Friendship
    ");
            }
            else if (res1 < res2){
                printf("First
    ");
            }
            else{
                printf("Second
    ");
            }
        }
        return 0;
    }
  • 相关阅读:
    彻底弄懂最短路径问题[转]
    activiti任务TASK
    linux查看磁盘空间
    Introduction to the POM
    【转】10 个迅速提升你 Git 水平的提示
    macbook安装mysql
    java并发编程之美-笔记
    springboot2精髓读书笔记
    java多线程
    实战JAVA虚拟机笔记
  • 原文地址:https://www.cnblogs.com/kirito520/p/7271320.html
Copyright © 2011-2022 走看看