|
|
back to boardCan't decrease program time (c#) Posted by bulka94 25 Dec 2013 00:07 using System; namespace TestOfCSharp { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int[] output = new int[N]; for (int c = 0; c < N; c++) { int K = int.Parse(Console.ReadLine()); int counter = 0; for (int j = 1; j <= K; j += counter, counter++) if (j == K) output[c] = 1; } foreach (int c in output) Console.Write("{0} ", c); } } } Re: Can't decrease program time (c#) Posted by BillSu 24 Apr 2014 08:33 Use formula wisely, not for... |
|
|