题解 | #游游开车出游#

游游开车出游

https://www.nowcoder.com/practice/667369e08b2f498c89a935df0af921b3

import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main {
    static void solve() {
        long  v = in.nextLong(),x = in.nextLong(),y = in.nextLong();
        double s = Math.sqrt(y*1.0/x), t = v*1.0/x;
        out.println(s>=t?2*s-t:y*1.0/v);
    }

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    static FastReader in = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    static class FastReader {
        static BufferedReader br;
        static StringTokenizer st;

        FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            String str = "";
            while (st == null || !st.hasMoreElements()) {
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                st = new StringTokenizer(str);
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


全部评论

相关推荐

老树开花:可以开始投了,不用等到觉得完全准备好。一边投一边根据面试反馈改简历是最高效的方式。简历上项目描述建议突出你解决的具体问题,比如编辑器的性能优化、大文档渲染怎么处理的,而不只是列技术栈。中厂前端实习现在竞争确实激烈,建议同时关注一些有AI业务的团队,前端加AI应用是很有差异化的组合。Vue全家桶基础扎实的话可以往SSR或者跨端方向延伸,这些是面试加分项。加油,时间还来得及。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务