楼主: Fanyare
跳转到指定楼层
上一主题 下一主题
收起左侧

[CareerCup] [第二轮] 2/18-2/24 CareerCup 1.7

🔗
莫有逆臣 2013-2-23 12:53:57 | 只看该作者
全局:
This is my first time here.
It is written in java.

https://gist.github.com/anonymous/5018494
回复

使用道具 举报

🔗
ThunderXu 2013-2-23 15:11:37 | 只看该作者
全局:
https://gist.github.com/ThunderXu/5018782
1. 遍历一遍,记录下需要置零的行和列
2. 对已记录的行和列置零
回复

使用道具 举报

🔗
 楼主| Fanyare 2013-2-24 10:06:35 | 只看该作者
回复

使用道具 举报

🔗
champoier 2013-2-24 14:49:21 | 只看该作者
全局:
用2个bool数组记录为0元素的row和col,然后再把这些行和列赋值成0.

https://gist.github.com/skxie/3f4afc289327369e3c64
回复

使用道具 举报

🔗
jerrysun 2013-2-24 20:58:36 | 只看该作者
全局:
回复

使用道具 举报

全局:
https://github.com/1094401996/Ca ... nedot7/SetZero.java

/**
* 2013.02.23
* 开两个位向量数组,一个记录行,一个记录列
* 零少的时候使用set1,多的时候使用set2
* */
回复

使用道具 举报

🔗
yueyuekitty 2013-2-25 08:49:41 | 只看该作者
全局:
规格严格理性帝 发表于 2013-2-25 05:48
https://github.com/1094401996/CareerCup/blob/master/Chapter1/onedot7/SetZero.java

/**

ls的分0多少而采取不同情况的思路值得借鉴!
我的:
https://gist.github.com/anonymous/5026553

多多指教!
回复

使用道具 举报

全局:
yueyuekitty 发表于 2013-2-24 17:49
ls的分0多少而采取不同情况的思路值得借鉴!
我的:
https://gist.github.com/anonymous/5026553

        第三行:        int nCol = mat[1].length;这样有bug...如果mat只有一行你代码就挂了。。。

回复

使用道具 举报

🔗
qiaobao 2013-2-25 13:14:44 | 只看该作者
全局:
1. Implement a list to store the position of  elements with 0.
2. Set corresponding row and column to 0.
Time complexity: O(MN)

https://gist.github.com/Andy1989/fee82ac3e7959090e5ac
回复

使用道具 举报

🔗
amoscoder 2013-2-26 20:25:49 | 只看该作者
全局:
思路:
       记录哪几个行列有0。之后再把满足的行列元素全部置零。

https://gist.github.com/KuangyinWang/5038064





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表