网易有道1012笔试

  1. 符合条件的vue模版
  2. 公共子序列最大长度
  3. 选择 出租房子还是存货的最大收益
  4. 洪水逃离最短时间

import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息

public class Main {
  public static boolean AllEmp(StringBuilder
							   s) {   //检查模版括号内是否全为空
	  String a = s.toString();
	  for (char ch : a.toCharArray()) {
		  if (ch != ' ')return false;
	  }
	  return true;
  }

  public static void main(String[] args) {

	  Scanner in = new Scanner(System.in);

	  Deque<String>st = new ArrayDeque();

	  String input = in.nextLine();

	  input = "/" + input + "/";                   //防止溢出

	  char[]a = input.toCharArray();

	  StringBuilder sb = new StringBuilder();

	  boolean beg = false;  //是否目前是包含在{{}}内的字符串

	  int id = 1;

	  while (id < a.length) {

		  if (a[id] == '}') {    //右括号
			  if (a[id + 1] == '}' && a[id - 1] != '}' && a[id + 2] != '}') {
				  if (st.isEmpty() || !st.peek().equals("{{") || st.size() != 1) {
					  System.out.print("false");
					  return;
				  } else {
					  st.pop();
				  }
				  if (AllEmp(sb)) {   //检查是否全为空
					  System.out.print("false");
					  return;
				  }
				  sb = new StringBuilder();
				  beg = false;
				  id++;
			  } else {
				  System.out.print("false");
				  return;
			  }
		  }

		  else if (a[id] == '{') {  //左括号
			  if (a[id + 1] == '{' && a[id - 1] != '{' && a[id + 2] != '{') {
				  beg = true;
				  st.push("{{");
				  id++;
			  } else {
				  System.out.print("false");
				  return;
			  }
		  }

		  else {            //普通字
			  if (beg)sb.append(a[id]);
		  }
		  id++;
	  }

	  if (st.isEmpty())System.out.print("true");
	  else System.out.print("false");

	  return;

  }
}
import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
	public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
		String t1 = in.nextLine();
		String t2 = in.nextLine();

		char[]c1 = t1.toCharArray();
		char[]c2 = t2.toCharArray();

		int m = c1.length, n = c2.length;

		int[][]f = new int[m + 1][n + 1]; //t1前m与t2前n

		for (int i = 0; i < m; i++)Arrays.fill(f[i], 0);

		for (int i = 1; i <= m; i++) {
			for (int j = 1; j <= n; j++) {
				f[i][j] = Math.max(f[i - 1][j], f[i][j - 1]);
				if (c1[i - 1] == c2[j - 1]) f[i][j] = Math.max(f[i - 1][j - 1] + 1, f[i][j]);
			}
		}

		System.out.print(f[m][n]);

	}
}

import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息

public class Main {
   public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int m = in.nextInt();
    int k = in.nextInt();
    int n = in.nextInt();

    int[]a = new int[n];
    for (int i = 0; i < n; i++)a[i] = in.nextInt();

    long[]f = new long[n];

    for (int i = 0; i < n; i++) {

        if (i > 0)f[i] = f[i - 1] + m;
        else f[i] = m;

        for (int j = 0; j < i; j++) {
            if (j > 0) {
                //[j,i]采用出租
                f[i] = Math.max(f[i], f[j - 1] + m * (i - j + 1));
			  //[j,i]采用存货
                f[i] = Math.max(f[i], f[j - 1] + a[i] - a[j] - 2 * k);
            } else {
                //[0,i]采用出租
                f[i] = Math.max(f[i], m * (i + 1));
			  //[0,i]采用存货
                f[i] = Math.max(f[i], a[i] - a[0] - 2 * k);
            }

        }
    }

    System.out.print(f[n - 1]);

	}
}


import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
	  public static boolean c(int a, int[][]g) {
		  //最大值为a时能否通过
		  int n = g.length;
		  Queue<Integer>q = new ArrayDeque();
		  boolean[][]vis = new boolean[n][n];
		  if (g[0][0] <= a){
			q.offer(0);
			vis[0][0] = true;
		  }

		  int[]d = new int[] {-1, 0, 1, 0, -1};

		  while (!q.isEmpty()) {
			  int i = q.poll();
			  int x = i / n, y = i % n;
			  if (x == n - 1 && y == n - 1)return true;
			  for (int k = 0; k < 4; k++) {
				  int nx = x + d[k], ny = y + d[k + 1];
				  if (nx >= 0 && nx < n && ny >= 0 && ny < n && !vis[nx][ny] && g[nx][ny] <= a) {
					  q.offer(n * nx + ny);
					  vis[nx][ny] = true;
				  }
			  }
		  }
		  return false;
	}


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

		int[][]g = new int[n][n];

		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)g[i][j] = in.nextInt();


		//从0,0-n-1,n-1路过最大值的最小值

		int l = -1, r = n * n;
		while (l + 1 < r) {
			int mid = (l + r) >> 1;
			if (c(mid, g))r = mid;
			else l = mid;
		}
		System.out.print(r);

	}
}

#网易求职进展汇总##笔试#
全部评论
无敌了
1 回复 分享
发布于 2025-10-12 12:20 江苏
a了3.67个照样挂,这个****
点赞 回复 分享
发布于 2025-10-20 16:39 浙江
我也挂了
点赞 回复 分享
发布于 2025-10-15 17:18 上海
笔试全a挂了
点赞 回复 分享
发布于 2025-10-15 17:01 北京
有后续约面了吗,官网还在笔试中呢
点赞 回复 分享
发布于 2025-10-14 19:12 北京
a了3.5 挂了
点赞 回复 分享
发布于 2025-10-14 09:44 重庆
全A了笔试也挂🤣
点赞 回复 分享
发布于 2025-10-14 00:20 北京
a了3.6,最后一道有0.4没a出来,感觉写的没问题
点赞 回复 分享
发布于 2025-10-13 08:32 黑龙江
第三题用卖股票的做法过了30%,感觉思路也没啥问题啊
点赞 回复 分享
发布于 2025-10-12 19:22 北京
我靠,我第三题直接用买卖股票只过了60%,不会是要用long数组吧,他喵的
点赞 回复 分享
发布于 2025-10-12 14:44 江西
100 100 10 12.5有机会进面吗
点赞 回复 分享
发布于 2025-10-12 12:34 江苏
点赞 回复 分享
发布于 2025-10-12 12:19 上海

相关推荐

2025-12-24 20:16
已编辑
吉林工程职业学院 Java
哈啰大家&nbsp;喵弟面试经验分享~bg:末9本投递:某杭州初创面试难度:地狱(因为是我第一次面试&nbsp;很多都没准备)结果:秒挂11.20&nbsp;初创公司面经1.看你简历中写到过实习经历,讲一下自己实习中都做了什么(说了一下实习的内容)2.看我的简历中写了MCP&nbsp;你知道什么是MCP吗(不知&nbsp;但其实这个实习就单纯做的数据标注和生产)3.那说说你的项目吧&nbsp;派聪明项目中的东西4.ollma&nbsp;docker&nbsp;es等&nbsp;都说不太认识5.说了一下jwt&nbsp;组成是什么&nbsp;作用6.开始redis部分&nbsp;先问了redis相关的基础知识&nbsp;项目中有没有redis相关的内容&nbsp;(回答了zset)7.讲讲zset吧&nbsp;什么底层原理&nbsp;你又在项目中怎么实现的&nbsp;(说了排行榜机制)8.说一下你的排行榜怎么保证加分的机制呢9.redis持久化有过了解吗&nbsp;(说的aof和rdb)10.redis分布式了解过吗&nbsp;(说的只了解分布式锁)11.那分布式锁的实现方式是怎么做的&nbsp;为什么redis可以实现分布式锁(根本不知道)12.消息队列了解吗&nbsp;rocketmq了解吗&nbsp;(暂时还没看&nbsp;不太了解)13.说的redis消息队列&nbsp;两种模式&nbsp;redis消息队列会出现什么问题&nbsp;(说的会出现线程安全)14.那怎么解决这个线程安全问题&nbsp;(回答的用zset来解决)15.说说mysql吧&nbsp;你了解哪些mysql存储引擎?&nbsp;(说的innodb&nbsp;myisam)那innodb和其他俩的区别是什么16.innodb的锁颗粒度能分到多少呢17.事务的隔离级别&nbsp;(读未&nbsp;读已&nbsp;可重复&nbsp;串行化)&nbsp;他们的优缺点18.场景&nbsp;abc联合索引&nbsp;ac&nbsp;ab都是怎么样的&nbsp;(回答的都可以命中索引&nbsp;他说我说的不对)19.说到了spring&nbsp;讲讲bean吧&nbsp;问到了bean的作用域(回答的很差)&nbsp;存在哪些问题&nbsp;(整个面试流程中但凡能继续深问的问题都问了这个&nbsp;我不明白)20.说到了spring&nbsp;mvc&nbsp;讲一下mvc的核心组件21.反问总结:当时觉得这个小公司要求我会的好多&nbsp;但现在看来&nbsp;真的挺基础&nbsp;这次的面试之后&nbsp;我搭配着AI&nbsp;给我的实践经历总结了一下(因为这个字节实习实际上就一干脏活的&nbsp;项目结束后也没给实习证明&nbsp;给的是实践证明&nbsp;当时报名这个项目的时候说给实习证明&nbsp;被骗了&nbsp;服了&nbsp;但是为了找第一段寒假实习&nbsp;我还是得包装一下讲一下的&nbsp;现在能讲出很多)然后每天让AI按着我的简历面试我&nbsp;八股我就逐渐熟悉了
文化小流氓:你的来时路会让你越来越强
查看18道真题和解析
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

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