Skip to content

Instantly share code, notes, and snippets.

@mormegil-cz
Created March 15, 2024 09:07
Show Gist options
  • Save mormegil-cz/b9ff704696061facb9d451dd8e121f31 to your computer and use it in GitHub Desktop.
Save mormegil-cz/b9ff704696061facb9d451dd8e121f31 to your computer and use it in GitHub Desktop.
Jasnovidec@Okoun
void Main()
{
for (int kol = 2; kol < 15; ++kol)
{
Console.WriteLine("{0}: {1}", kol, Enumerable.Range(0, 1 << kol).Select(i => Check(Enumerable.Range(0, kol).Select(b => (i & (1 << b)) == 0 ? 0 : 1).ToList())).Min());
}
}
static int Check(List<int> krupier) =>
Enumerable.Range(0, 2).Select(rada =>
{
var pocet = krupier.Count;
var diktatu = Enumerable.Range(1, pocet -1).Count(k => krupier[k] == rada);
return Enumerable.Range(1, pocet - diktatu - 1).Count(k => krupier[k] == rada) + diktatu;
}).Max();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment