笔试手记-----20170826之360

1.第一题

这题是,。,,题目忘了,很多参数的样子,不过还是凭着我数学的直觉推出了里面的猫腻,很快解决了,虽然我也不知道为啥就行,真的,我觉得还有很多情况需要考虑,比如我在纠结除数怎么考虑。

import java.util.Scanner;

public class Main {


    public static int max(int n, int m, int a, int b, int c, int d, int x, int y, int z) {
        int temp1 = n / (a + b);
        int temp2 = m / (a + b);
        int temp = Math.min(temp1, temp2);
        int A = (x - (b * y) / c - a * z / d);
        int B = z * n / d;
        int C = y * m / c;
        return A * temp + B + C;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int d = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int z = sc.nextInt();


            System.out.println(n + " " + m);
            System.out.println(a + " " + b + " " + c + " " + d);
            System.out.println(x + " " + y + " " + z);


            System.out.println("result:" + max(n, m, a, b, c, d, x, y, z));
        }
    }

2.第二题

第二题是求逆序对的问题,不是求出一个数字而是求出具体的每一个数对应的逆序对数。看了下归并逆序不知道怎么改。于是暴力了一下居然能过80%。。。。。

3.总结

总体来说360略坑,因为选择题真的很多C++的题,我应该抽点时间看看C++了,这样说不定还能投投C++岗,必考内容就是析构函数执行了多少次。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值