mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-14 20:17:09 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace _492A
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int n = int.Parse(Console.ReadLine());
|
||||
int a = 0, b = 0, c = 0;
|
||||
while (n > c)
|
||||
{
|
||||
a++;
|
||||
b = a * (a + 1) / 2;
|
||||
c += b;
|
||||
}
|
||||
Console.WriteLine(c > n ? a - 1 : a);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user