Skip to content

Commit 7d05f29

Browse files
committed
2018-03-28 22:05
1 parent d876f2a commit 7d05f29

File tree

1 file changed

+3
-3
lines changed
  • 网易2019实习生招聘编程题集合

1 file changed

+3
-3
lines changed

网易2019实习生招聘编程题集合/01.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main()
2525
people[i].index = i;
2626
}
2727
sort(work, work + n, cmp1);
28-
sort(people, people + n, cmp2);
28+
sort(people, people + m, cmp2);
2929
int j = 0, maxMoney = 0;
3030
for (int i = 0; i < m; i++) {
3131
while (j < n) {
@@ -37,8 +37,8 @@ int main()
3737
}
3838
people[i].money = maxMoney;
3939
}
40-
sort(people, people + n, cmp3);
41-
for (int i = 0; i < n; i++) {
40+
sort(people, people + m, cmp3);
41+
for (int i = 0; i < m; i++) {
4242
cout << people[i].money << endl;
4343
}
4444
delete[] work;

0 commit comments

Comments
 (0)