冋宇同桌 level
获赞
3152
粉丝
84
关注
51
看过 TA
63
浙江工业大学
2019
C++
IP属地:浙江
字节跳动内推码: GN4XTRV
私信
关注
2019-08-04 11:02
浙江工业大学 C++
0 点赞 评论 收藏
分享
2019-08-03 11:02
浙江工业大学 C++
0 点赞 评论 收藏
分享
2018-09-14 16:07
浙江工业大学 C++
0 点赞 评论 收藏
分享
2018-08-30 21:00
浙江工业大学 C++
好久没水贴了,发一个凑凑热闹( 第一题:打怪物,贪心,比一下蓄力和不蓄力区别就行了  #include <bits/stdc++.h> using namespace std; long long int hp, n, b; int ans = 0; int main() { std::ios::sync_with_stdio(false); //freopen("input.txt", "r", stdin); cin >> hp >> n >> b; ans = 0; if (2*n > b) {...
梅毒菊花茶:我来发个Java的 import java.util.Scanner; /** * 贪心 */ public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long hp = in.nextLong(); long x = in.nextLong(); long y = in.nextLong(); long ans1 = hp / x; if (hp % x != 0) { ans1++; } long ans2 = hp / (y) * 2; hp %= y; long ans; if (hp == 0) { } else if (hp <= x) { ans2++; } else { ans2 += 2; } ans = Math.min(ans1, ans2); System.out.println(ans); } } import java.util.Scanner; /** * 模拟 */ public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); char[][] a = new char[n][m]; in.nextLine(); for (int i = 0; i < n; i++) { String line = in.nextLine(); a[i] = line.toCharArray(); } for (int j = 0; j < m; j++) { int s = 0; for (int i = 0; i < n; i++) { if (a[i][j] == 'o') { a[i][j] = '.'; s++; } if (a[i][j] == 'x') { for (int k = 1; k <= s; k++) { a[i-k][j] = 'o'; } s = 0; } } } for (int i = 0; i < n; i++) { System.out.println(a[i]); } } } import java.util.Map; import java.util.Scanner; import java.util.TreeMap; /** * 模拟 */ public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); Map<Integer, Integer> mp = new TreeMap<>(); a %= b; for (int i = 0; ;i++) { int x = a % b; if (x == 0) { System.out.println(i + " 0"); break; } Integer t = mp.get(x); if (t != null) { System.out.printf("%d %d\n", t, i - t); break; } mp.put(x, i); a = x * 10; } } } import java.util.*; /** * 深搜 */ public class Main { static int n; static int l; static List<Set<Character> > b; static Set<String> st; static boolean flag = false; static void dfs(int k, StringBuilder sb) { if (flag) { return; } if (k == l) { if (!st.contains(sb.toString())) { System.out.println(sb); flag = true; } return; } b.get(k).forEach(character -> { StringBuilder ssb = new StringBuilder(sb); ssb.append(character); dfs(k + 1, ssb); }); } public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); l = in.nextInt(); in.nextLine(); String[] s = new String[n]; st = new TreeSet<>(); for (int i = 0; i < n; i++) { s[i] = in.nextLine(); st.add(s[i]); } b = new ArrayList<>(); for (int i = 0; i < l; i++) { b.add(new TreeSet<>()); } for (int j = 0; j < l; j++) { for (int i = 0; i < n; i++) { b.get(j).add(s[i].charAt(j)); } } dfs(0, new StringBuilder()); if (!flag) { System.out.println("-"); } } }
投递拼多多集团-PDD等公司10个岗位
0 点赞 评论 收藏
分享
2018-04-09 21:44
浙江工业大学 C++
4月11日10点视频面,不知道是不是连着面的,也不知道需要多少时间。。&nbsp;&nbsp;&nbsp;刚收到4月11日下午3点有腾讯的现场面,不知道到时候来不来得及赶过去
薯条番茄酱🍟:楼主面过了么  视频面是不是牛客平台 让手撸代码了? 刚接到下周一视频面 很慌
投递网易雷火等公司10个岗位
0 点赞 评论 收藏
分享
2018-04-05 17:02
浙江工业大学 C++
第一题:求前n项的和,找规律,注意结果是&nbsp;long&nbsp;long&nbsp;int&nbsp;&nbsp;#include&nbsp;&lt;iostream&gt;&nbsp;#include&nbsp;&lt;vector&gt;&nbsp;#include&nbsp;&lt;map&gt;&nbsp;#include&nbsp;&lt;cstring&gt;&nbsp;#include&nbsp;&lt;string&gt;&nbsp;#include&nbsp;&lt;algorithm&gt;&nbsp;using&nbsp;namespace&nbsp;std;&nbsp;long&nbsp;long&nbsp;int&nbsp;a,&nbsp;b;&nbsp;int&nbsp;main()&nbsp;{&nbsp;ios::sync_with_stdio(false);&nbsp;//freopen(&quot;input.txt&quot;,&nbsp;&...
spaceQ:我也觉得贪心有问题,下面这个样例,我跑你的程序输出的是 >> input 2 2 2 99 1 100 1 99 2 0 >> output 1 497 明显答案有问题。 任务 1(1,99) 的 profit 大于任务 2 (2,0),会安排到等级最小时间满足的机器 1 (2,99)上完成。然而,之后的任务 2 (2,0)就无法安排到 (1,100)上完成。 选择等级最小时间满足(较大)的情况并没有优于选择等级稍大时间满足(稍小)的情况。
投递腾讯等公司10个岗位
0 点赞 评论 收藏
分享
2018-03-27 21:39
浙江工业大学 C++
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务