Last active
December 25, 2015 16:49
-
-
Save cocodrips/7008271 to your computer and use it in GitHub Desktop.
SRM587 Div2 500 高々最初の1ステップをとどまるかとどまらないかを調べるだけ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*__SRM587 Div2 500__*/ | |
public class JumpFurther { | |
public int furthest(int N, int badStep) { | |
int step = 0; | |
for (int i = 1; i <= N; i++) { | |
step += i; | |
if (step == badStep) { | |
step--; | |
} | |
} | |
return step; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment