|
|
вернуться в форумwrong ans #4.Is there any test. import java.util.Scanner; /** * Created by Coder on 05.12.2014. */ public class Copy1131_ { public static void main(String[] args) { Scanner x = new Scanner(System.in); int n = x.nextInt(); int k = x.nextInt(); int time = 0, i = 1; long s = 1; while (s < n) { if (i >= k) { s += k; } else { s += i++; } time++; } System.out.println(time); } } Re: wrong ans #4.Is there any test. Послано বাঙালি 22 окт 2015 17:44 TRY : 7 2 u should get: 4 Re: wrong ans #4.Is there any test. Послано বাঙালি 22 окт 2015 17:44 TRY : 7 2 u should get: 4 |
|
|