ttma1046 最近的时间轴更新
ttma1046's repos on GitHub
Java · 3 人关注
Algorithms-CC
Algorithms
TypeScript · 1 人关注
angular
One framework. Mobile & desktop.
TypeScript · 1 人关注
angular-form-cva
angular form - control value accessor
TypeScript · 1 人关注
angular-form-in-depth
Angular Form in Depth
TypeScript · 1 人关注
angular-karam-testing
angular-karam-testing
JavaScript · 1 人关注
angular-library-cli
A CLI tool for building Angular library
JavaScript · 1 人关注
angular-starter
Angular Starter
TypeScript · 1 人关注
angular-unit-test
angular-unit-test
JavaScript · 1 人关注
angularjs-directive
Angular Directives
TypeScript · 0 人关注
ac-forms
C# · 0 人关注
algo-practice
Algorithms Practice
JavaScript · 0 人关注
AlgoCasts
C# · 0 人关注
Algorithms
ttma1046/Algorithms
Java · 0 人关注
algs4
algs4
0 人关注
Angular-2-Resources
Angular 2 Resources
TypeScript · 0 人关注
Angular-Demo
Demo site done in 90 minutes
TypeScript · 0 人关注
angular-di
Angular Dependency Injection
TypeScript · 0 人关注
angular-hero-ssr
Angular Hero Sample with Angular Universal (SSR)
JavaScript · 0 人关注
angular-ivy-demo
Demo repository showing how ivy allows significant API simplification.
JavaScript · 0 人关注
angular-presentation
Sample code and slides for my angular presentation.
TypeScript · 0 人关注
angular-pro-course-1
angular-tutorial-advanced
TypeScript · 0 人关注
angular-pro-course-2
UltimateAngular Angular Pro Course
TypeScript · 0 人关注
angular-pro-course-3
angular-pro-course
TypeScript · 0 人关注
angular-seed
Modular starter project for Angular 2 (and beyond) with statically typed build and AoT compilation
TypeScript · 0 人关注
angular-shopping-cart
TypeScript · 0 人关注
angular-tour-of-heroes
Angular.io Tutorial
JavaScript · 0 人关注
angular2-quickstart
Angular.io Basics
TypeScript · 0 人关注
angular2-test
Little Angular 2 test demo based on Angular.io Testing.
TypeScript · 0 人关注
angular2-tour-of-heroes
angular2-tour-of-heroes V2
TypeScript · 0 人关注
angular2-tour-of-heros
Angular 2 Tour of Heroes
ttma1046

ttma1046

V2EX 第 126872 号会员,加入于 2015-07-13 09:17:43 +08:00
求帮忙做到题!谢谢谢谢!
程序员  •  ttma1046  •  2016-02-11 16:08:43 PM  •  最后回复来自 sengxian
14
求删
Chamber  •  ttma1046  •  2015-11-07 06:24:29 AM  •  最后回复来自 ynyounuo
1
ttma1046 最近回复了
页面最底下有个下拉框可以选国家的
Feedly + pocket
2016-03-07 13:02:03 +08:00
回复了 hoythan 创建的主题 Linux 救命,我可能要被老板砍死了。
@yeyeye thumbs up!
2016-03-05 10:20:51 +08:00
回复了 xdlailai 创建的主题 程序员 百度前端技术学院求认真的队友组队
求组队, qq 66730717
string 加任何玩儿,都是把任何玩儿先变成 string, 再做 concat.
百撕不得骑姐楼主怎么略懂 JS 的 ?
ecmascript 的官方文档
2016-02-07 06:09:58 +08:00
回复了 ttma1046 创建的主题 程序员 求帮忙做到题!谢谢谢谢!
```csharp
public int solution(int[] selectiveDates)
{
int [] minCost = new int[31];

for (int date = 0; date < 31; date++)
{
int oneDayAgo = 0;
if (date - 1 > 0)
oneDayAgo = date - 1;


if (selectiveDates.Contains(date))
{
int sevenDaysAgo = 0;
if (date - 7 > 0)
sevenDaysAgo = date - 7;

int thirtyDaysAgo = 0;
if (date - 30 > 0)
thirtyDaysAgo = date - 30;

minCost[date] = Math.Min(minCost[sevenDaysAgo] + 7, minCost[thirtyDaysAgo] + 25);
minCost[date] = Math.Min(minCost[date], minCost[oneDayAgo] + 2);
}
else
{
minCost[date] = minCost[oneDayAgo];
}
}

return minCost[30];
}
```
2016-02-07 06:09:31 +08:00
回复了 ttma1046 创建的主题 程序员 求帮忙做到题!谢谢谢谢!
@yuriko @3pointer
写的很垃圾,求拍砖

public int solution(int[] selectiveDates)
{
int [] minCost = new int[31];

for (int date = 0; date < 31; date++)
{
int oneDayAgo = 0;
if (date - 1 > 0)
oneDayAgo = date - 1;


if (selectiveDates.Contains(date))
{
int sevenDaysAgo = 0;
if (date - 7 > 0)
sevenDaysAgo = date - 7;

int thirtyDaysAgo = 0;
if (date - 30 > 0)
thirtyDaysAgo = date - 30;

minCost[date] = Math.Min(minCost[sevenDaysAgo] + 7, minCost[thirtyDaysAgo] + 25);
minCost[date] = Math.Min(minCost[date], minCost[oneDayAgo] + 2);
}
else
{
minCost[date] = minCost[oneDayAgo];
}
}

return minCost[30];
}
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1041 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 22:29 · PVG 06:29 · LAX 14:29 · JFK 17:29
Developed with CodeLauncher
♥ Do have faith in what you're doing.