This commit is contained in:
Debug_pro
2026-03-03 04:00:06 +03:00
commit 8d81324fd9
7 changed files with 571 additions and 0 deletions

25
Utils.cs Normal file
View File

@@ -0,0 +1,25 @@
namespace Prac7Meow
{
internal class Utils
{
public static int NearPow(int n)
{
if (n == 0) return 0;
if (n <= 2) return 2;
uint val = (uint)n;
val--;
val |= val >> 1;
val |= val >> 2;
val |= val >> 4;
val |= val >> 8;
val |= val >> 16;
val++;
if (val == 0) throw new OverflowException("Requested capacity is too large for int.");
return (int)val;
}
}
}