Redian新闻
>
黄私带笑话 -- 给大家拜个晚年
avatar
黄私带笑话 -- 给大家拜个晚年# Joke - 肚皮舞运动
m*r
1
肯定是在数钱,我就不点名了
avatar
L*k
2
leetcode 几乎把easy 和middle 的做了一遍
面试了十几个公司,电面都很好。可是一旦考程序就挂。
怎么回事?
我已经找工作找了3个月了。
是不是要狠心把leetcode 再刷几遍?
avatar
x*o
3
即将迎来羊年之际,我给大家拜个晚年:祝大家马年快乐
春晚荟萃 ---- begin
一首《从前慢》献给早泄患者
那英心里想:去尼玛的,你个死羊让全国观众都知道老娘48了!
看了看节目单,这届春晚充斥着浓厚的雄性荷尔蒙,邀请了张丰毅,朱亚文、段奕宏,
韩磊,吴京,张震等一众硬汉,弃掉了刘谦,YIF,以及韩国欧巴。最后导演组还是嫌
不够男人味,又特地找来了春哥
小姑娘给冯巩二十块钱把自己卖给高晓攀,看的阿森纳球迷想哭,这不就是法布雷加斯
么?
冯巩51岁,女儿25岁,冯巩25的时候在照顾女儿……这是啥子意思?
刚才蔡明一脸埋怨说“你行不行啊”,潘长江喘着粗气说“哎你快从后面推我一把…”
《蜀绣》作词居然是郭敬明?卧槽我不信!他写出来的词不应该是“君可见Gucci绿花
裙上刺绣每一针,有个穿Fendi皮草的人为你疼;君可见如Dior香般的牡丹开一生,有
个披着Bottega Veneta秋款皮夹克的人为你等…”这种的吗?//@郭敬明:大过年的,别
这样
春晚魔术印象最深的还是刘谦,怀念那种「大家伙都知道董卿是托,但董卿以为大家不
知道还非常投入地演呢」的感觉。不得不说,周家宏和刘谦之间差了一百个董卿
当冯巩说出“我想死你们啦”时,全国人民都松了一口气……感觉不听就像没过年
刚才上网搜了一下刘和刚的歌,发现他唱过《父亲》,唱过《妈妈》,唱过《姐姐》,
还唱过一首《孩子妈》、《当你的秀发拂过我的钢枪》。估计接下来还会唱《咱家娃》
、《小姨子》、《二舅妈》、《三大爷》
看到杂技《青花瓷》,在玩电脑的我爸嘟囔了一句“唉,这个周杰伦真不容易,现在的
明星真是啥都得会啊。”
亲戚的熊孩子们一听小苹果的前奏就扭腰准备开跳了,然后被突然插入的最炫民族风惊
得完全不知所措了,足足愣了一整个节目 #干得漂亮央视
“拒绝黄,拒绝赌,拒绝乒乓球!”这是春晚透露出的中央重要指示,表明习大大决定
乒乓不能在“国球”的地位上待着了,结合习大大上任后对足球的高度重视和一系列—
—我们认爲这是足球即将接任“国球”的徵兆 —— 洋葱记者报道
春晚荟萃 ---- end
国外还为羊年的羊指的是山羊还是绵羊吵了起来。对中国人来说,这没什么可争的,羊
指的就是山羊,羊字画的是山羊。绵羊原属塞外的东西。 via fangshimin
刚才跟我妈妈在外面,我妈妈吹着指甲跟大家说,“我女儿这么多年有一个优点挺好的
” 我等着她夸我聪明,机灵,勤快,等的脸都要红了,整个人的羞涩是抑制不住的。
然后我妈妈说 “从来不挑食。”
今天去买葡萄时对老板说:这葡萄让尝么?老板说:不让尝。我说:那怎么看他甜不甜
啊。老板想了想说:我来尝,你看我表情买......
老姐在网上下了个土耳其语速成APP,第一课是:“我把钱全给你,不要伤害我”“我
从朝鲜来,所以我不是有钱人”“我喝醉了,你能送我回家吗?”
人啊,长了颗红楼梦的心,却生活在水浒的世界,想交些三国里的桃园弟兄,却总遇到
些西游记里的妖魔鬼怪
刚才打报告,negative binomial distribution负二项分布,打成了富二代分布
妈妈刚才问我:老盯着手机干什么?我说:抢红包。妈妈说:能抢多少? 我说:看手法,
有时候白忙,有时候几分钱到一两块。老妈说:我给你10块,你去给我把锅刷了....
老师:金钱与智慧,你们会选什么? 小明:我当然是要金钱! 老师:而我会选择智慧
,你知道为什么吗? 小明:当然,人们都会选择自己缺少的东西,我能理解! 老师:
滚!
avatar
y*u
4
大b神
omg

【在 m*r 的大作中提到】
: 肯定是在数钱,我就不点名了
avatar
z*8
5
Why not paste your code here?
avatar
l*u
6
沙发
avatar
a*e
7
gengxin跟bison,现在忙着issue label吧

【在 m*r 的大作中提到】
: 肯定是在数钱,我就不点名了
avatar
L*k
8
Problem Description
-------------------
Your task is to write a command-line program to evaluate a set of
equations, each specified on separate lines. An equation is defined
by:
=
is the left-hand side of the equation and is always a variable
name. A variable name can only be composed of letters from the
alphabet (e.g. for which isalpha(c) is 1). is the right hand
side of the equation and can be composed of variables, unsigned
integers, and the + operator.
Here is one example set of equations:
offset = 4 + random + 1
location = 1 + origin + offset
origin = 3 + 5
random = 2
Your program should take a filename as input. The file contains a set
of equations, like the above. It should evaluate the set of equations
and print the unsigned integer value of each variable.
=
The output should be sorted by in ascending order by variable name.
The output for the example above would be:
location = 16
offset = 7
origin = 8
random = 2
You may assume the following: You may assume the input is well formed.
There will be one or more white spaces between each token. You may use
C++, the Standard C libraries and the Standard Template Library (STL).
You may use std::sort and qsort. All variables in the equation set
will have a definition. You may also assume a variable is only defined
once and will have a valid integer solution.
Submission
----------
We recognize that your time is valuable so please wind down your
investigations if you hit the 3 hour mark, or earlier if you hit
diminishing returns.
Submit your submission to me via email with the following:
1. Source code
2. Example output
3. (if necessary) instructions on how to build and execute your code
4. (optionally) any thoughts you'd like to share
avatar
H*g
9
尔其还不错,还有地方可以喝醉
==
老姐在网上下了个土耳其语速成APP,第一课是:“我把钱全给你,不要伤害我”“我
从朝鲜来,所以我不是有钱人”“我喝醉了,你能送我回家吗?”
avatar
s*j
10
呼唤B神
avatar
L*k
11
my solution:
#include
#include
#include
#include
#include
#include
#include
using namespace std;
void jf_eval(string& in_line, unordered_map
>>& record)
{
int i_dex = in_line.find_first_of(' ');
string cur_var = in_line.substr(0, i_dex);
vector varibles;
int cur_value = 0, ele = 0;
bool new_variable = true, new_number = true; int index1 = 0;
int i = i_dex;
for (; i < in_line.size(); ++i)
{
if (isdigit(in_line[i]))
{
new_number = false;
ele = ele * 10 + in_line[i] - '0';
}
else if (!isdigit(in_line[i]) && !new_number)
{
new_number = true;
cur_value += ele;
ele = 0;
}
if (isalpha(in_line[i]) && new_variable)
{
index1 = i;
new_variable = false;
}
else if (!isalpha(in_line[i]) && !new_variable)
{
new_variable = true;
varibles.push_back(in_line.substr(index1, i - index1));
index1 = 0;
}

}
if (ele) cur_value += ele;
if (index1) varibles.push_back(in_line.substr(index1, i - index1));
record[cur_var] = make_pair(cur_value, varibles);
}
int jf_assign(string key, unordered_map>>&
record)
{
if (!record[key].second.size())
return record[key].first;
else
{
int elevalue = record[key].first;
for (auto unres : record[key].second)
{
elevalue += jf_assign(unres, record);
}
return elevalue;
}
}
void main()
{
string line;
ifstream myfile("input.txt");
ofstream resfile;
resfile.open("output.txt");
unordered_map>> record;
if (myfile.is_open())
{
//string line_res;
while (getline(myfile, line))
{
cout << line << '\n';
jf_eval(line, record);
//resfile << line_res << '\n';
}
myfile.close();
vector jfresult;
for (auto ele : record)
{
ostringstream ss;
ss << jf_assign(ele.first, record);

string temp = ele.first + " = " + ss.str();
jfresult.push_back(temp);
}
sort(jfresult.begin(), jfresult.end());
for (auto ele : jfresult)
{
resfile << ele << '\n';
}
resfile.close();
}
else cout << "Unable to open file";

}
avatar
m*l
12
“当你的秀发拂过我的钢枪”,这个有内涵
avatar
n*r
13
毛神出来毛了。娃哈哈。

【在 m*r 的大作中提到】
: 肯定是在数钱,我就不点名了
avatar
b*5
14
我觉得你这种要写很多code的, 最好给点comments。。。 人家看你code的人,也是人
啊。。 骂了一天的code, 还要看你的commentless code, 头都疼啊

string>

【在 L******k 的大作中提到】
: my solution:
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: using namespace std;
: void jf_eval(string& in_line, unordered_map

avatar
d*3
15
找了半天没找到黄的啊
avatar
f*g
16
同呼唤B神
avatar
j*n
17
#include
#include
#include
#include
#include
#include
#include
using namespace std; //这个最好解释一下不会真的在production上这么写
void jf_eval(string& in_line, unordered_map
//jf 是什么意思?
>>& record)
{
int i_dex = in_line.find_first_of(' ');
string cur_var = in_line.substr(0, i_dex);
vector varibles;
int cur_value = 0, ele = 0;
bool new_variable = true, new_number = true; int index1 = 0;
int i = i_dex;
for (; i < in_line.size(); ++i)
{
if (isdigit(in_line[i]))
{
new_number = false;
ele = ele * 10 + in_line[i] - '0';
}
else if (!isdigit(in_line[i]) && !new_number)
{
new_number = true;
cur_value += ele;
ele = 0;
}
if (isalpha(in_line[i]) && new_variable)
{
index1 = i;
new_variable = false;
}
else if (!isalpha(in_line[i]) && !new_variable)
{
new_variable = true;
varibles.push_back(in_line.substr(index1, i - index1));
index1 = 0;
}

}
if (ele) cur_value += ele;
if (index1) varibles.push_back(in_line.substr(index1, i - index1));
/*上面那堆也可以就这样就可以了
stringstream ss;
ss << in_line ;
ss >> cur_var;
string nouse;
ss >> nouse;
vector variables;
while(ss){
string curVal;
ss >> curVal;
检查curVal是= 还是数字还是variable
}
*/
record[cur_var] = make_pair(cur_value, varibles);
}
int jf_assign(string key, unordered_map>>&
record)
{
if (!record[key].second.size())
return record[key].first;
else
{
int elevalue = record[key].first;
for (auto unres : record[key].second)
{
elevalue += jf_assign(unres, record);
}
//这最好把最终结果赋给record[key].first 然后清空record[key].second
//省的每次都要重新算
return elevalue;
}
}
void main()
{
string line;
ifstream myfile("input.txt");
ofstream resfile;
resfile.open("output.txt");
unordered_map>> record;
if (myfile.is_open())
{
//string line_res;
while (getline(myfile, line))
{
cout << line << '\n';
jf_eval(line, record);
//resfile << line_res << '\n';
}
myfile.close();
vector jfresult;
for (auto ele : record)
{
ostringstream ss;
ss << jf_assign(ele.first, record);

string temp = ele.first + " = " + ss.str();
jfresult.push_back(temp);
}
sort(jfresult.begin(), jfresult.end());
for (auto ele : jfresult)
{
resfile << ele << '\n';
}
resfile.close();
}
else cout << "Unable to open file";

}
avatar
i*l
18
看到《当你的秀发拂过我的钢枪》的时候,莫名硬了
avatar
L*k
19

string>
多谢指点,我仔细看看您的注释

【在 j*****n 的大作中提到】
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: using namespace std; //这个最好解释一下不会真的在production上这么写
: void jf_eval(string& in_line, unordered_map
: //jf 是什么意思?

avatar
h*e
20
小明终于滚了,俺过年也过得放心了。
avatar
i*e
21
你是否已经有许多软件工作的经验 ?
你被拒绝, 是否不是由于你刷题不行, 而是由于你实际做项目的经验不够呢 ?
我也在考虑转行软件, 大家一起努力吧。
如果你在硅谷南湾, 你可以试试这个。
http://www.mitbbs.com/article/JobHunting/32988555_0.html

【在 L******k 的大作中提到】
: leetcode 几乎把easy 和middle 的做了一遍
: 面试了十几个公司,电面都很好。可是一旦考程序就挂。
: 怎么回事?
: 我已经找工作找了3个月了。
: 是不是要狠心把leetcode 再刷几遍?

avatar
f*8
22
+1

【在 h******e 的大作中提到】
: 小明终于滚了,俺过年也过得放心了。
avatar
c*d
23
从函数定义就可以看出你经验不足:
void jf_eval(string& in_line, unordered_map < string, pairstring>>> &record)
-->
void jf_eval(const string& in_line, unordered_map < string, pair>> &record)
int jf_assign(string key, unordered_map>>&
record)
-->
int jf_assign(const string& key, const unordered_map>>& record)

【在 L******k 的大作中提到】
: leetcode 几乎把easy 和middle 的做了一遍
: 面试了十几个公司,电面都很好。可是一旦考程序就挂。
: 怎么回事?
: 我已经找工作找了3个月了。
: 是不是要狠心把leetcode 再刷几遍?

avatar
T*e
24
方是民一锤定音

【在 x****o 的大作中提到】
: 即将迎来羊年之际,我给大家拜个晚年:祝大家马年快乐
: 春晚荟萃 ---- begin
: 一首《从前慢》献给早泄患者
: 那英心里想:去尼玛的,你个死羊让全国观众都知道老娘48了!
: 看了看节目单,这届春晚充斥着浓厚的雄性荷尔蒙,邀请了张丰毅,朱亚文、段奕宏,
: 韩磊,吴京,张震等一众硬汉,弃掉了刘谦,YIF,以及韩国欧巴。最后导演组还是嫌
: 不够男人味,又特地找来了春哥
: 小姑娘给冯巩二十块钱把自己卖给高晓攀,看的阿森纳球迷想哭,这不就是法布雷加斯
: 么?
: 冯巩51岁,女儿25岁,冯巩25的时候在照顾女儿……这是啥子意思?

avatar
l*g
25
variable 拼不对估计直接就跪了
avatar
n*g
26
倒了。

【在 x****o 的大作中提到】
: 即将迎来羊年之际,我给大家拜个晚年:祝大家马年快乐
: 春晚荟萃 ---- begin
: 一首《从前慢》献给早泄患者
: 那英心里想:去尼玛的,你个死羊让全国观众都知道老娘48了!
: 看了看节目单,这届春晚充斥着浓厚的雄性荷尔蒙,邀请了张丰毅,朱亚文、段奕宏,
: 韩磊,吴京,张震等一众硬汉,弃掉了刘谦,YIF,以及韩国欧巴。最后导演组还是嫌
: 不够男人味,又特地找来了春哥
: 小姑娘给冯巩二十块钱把自己卖给高晓攀,看的阿森纳球迷想哭,这不就是法布雷加斯
: 么?
: 冯巩51岁,女儿25岁,冯巩25的时候在照顾女儿……这是啥子意思?

avatar
p*r
27
电面本来就很容易,
我除了一边带娃/吃饭/开车,一边电面这种分心的情况,
不然貌似没不过的。
avatar
H*3
28
不硬那能叫钢枪吗?

★ 发自iPhone App: ChineseWeb 1.0.1

【在 i******l 的大作中提到】
: 看到《当你的秀发拂过我的钢枪》的时候,莫名硬了
avatar
l*k
29
应该开个code review版
avatar
n*g
30
就你多想。

【在 i******l 的大作中提到】
: 看到《当你的秀发拂过我的钢枪》的时候,莫名硬了
avatar
f*a
31
要写上comment吗?
avatar
p*i
32
我给大家拜个早年吧,祝大家猴年快乐!

【在 x****o 的大作中提到】
: 即将迎来羊年之际,我给大家拜个晚年:祝大家马年快乐
: 春晚荟萃 ---- begin
: 一首《从前慢》献给早泄患者
: 那英心里想:去尼玛的,你个死羊让全国观众都知道老娘48了!
: 看了看节目单,这届春晚充斥着浓厚的雄性荷尔蒙,邀请了张丰毅,朱亚文、段奕宏,
: 韩磊,吴京,张震等一众硬汉,弃掉了刘谦,YIF,以及韩国欧巴。最后导演组还是嫌
: 不够男人味,又特地找来了春哥
: 小姑娘给冯巩二十块钱把自己卖给高晓攀,看的阿森纳球迷想哭,这不就是法布雷加斯
: 么?
: 冯巩51岁,女儿25岁,冯巩25的时候在照顾女儿……这是啥子意思?

avatar
m*n
33
胡说几句供参考。c++看着费劲就没仔细看,说错了请勿怪。
这个程序在算法方面有两个问题:
1. 没有一个报错机制。给个 v1 = v2 ; v2 = v1; 程序就无限循环了吧。“v =
3 + ”, “v= v2 - 1” 这种非法输入好像也能混过去。
2. 没用Cache记录计算出的变量。出现多次的变量会重复计算。
另外Line parsing 函数比较乱。要是用一个函数先tokenize再用另一个函数处理会好
些。

string>

【在 L******k 的大作中提到】
: my solution:
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: using namespace std;
: void jf_eval(string& in_line, unordered_map

avatar
i*e
34
最近几个月是不是面试少了 ?
大公司是不是不招人了 ?
================================================================
你是否已经有许多软件工作的经验 ?
你被拒绝, 是否不是由于你刷题不行, 而是由于你实际做项目的经验不够呢 ?
我也在考虑转行软件, 大家一起努力吧。
如果你在硅谷南湾, 你可以试试这个。
http://www.mitbbs.com/article/JobHunting/32988555_0.html

【在 L******k 的大作中提到】
: leetcode 几乎把easy 和middle 的做了一遍
: 面试了十几个公司,电面都很好。可是一旦考程序就挂。
: 怎么回事?
: 我已经找工作找了3个月了。
: 是不是要狠心把leetcode 再刷几遍?

avatar
h*3
35
是说 onsite 的时候在机器上写程序么?
你说的店面都不 考 online programming ?

【在 L******k 的大作中提到】
: leetcode 几乎把easy 和middle 的做了一遍
: 面试了十几个公司,电面都很好。可是一旦考程序就挂。
: 怎么回事?
: 我已经找工作找了3个月了。
: 是不是要狠心把leetcode 再刷几遍?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。