Soy.FireFly 0.1.0-alpha.1

This is a prerelease version of Soy.FireFly.
dotnet add package Soy.FireFly --version 0.1.0-alpha.1
                    
NuGet\Install-Package Soy.FireFly -Version 0.1.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soy.FireFly" Version="0.1.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soy.FireFly" Version="0.1.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="Soy.FireFly" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soy.FireFly --version 0.1.0-alpha.1
                    
#r "nuget: Soy.FireFly, 0.1.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soy.FireFly@0.1.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soy.FireFly&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Soy.FireFly&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Tool

FireFly

简体中文

FireFly is a compact C# 13 algorithm library for competitive programming. It keeps contest code direct and allocation-conscious, while SourceExpander turns the parts used by a solution into a single Combined.csx submission file.

Status: FireFly is in 0.1 alpha. APIs may change before 1.0.

Installation

The NuGet package ID is Soy.FireFly, and the first release is 0.1.0-alpha.1. When that version is available on NuGet, install it together with SourceExpander:

dotnet add path/to/Contest.csproj package Soy.FireFly --version 0.1.0-alpha.1
dotnet add path/to/Contest.csproj package SourceExpander --version 9.1.2

If the version has not been published yet, or when developing against a local checkout, clone this repository and use a project reference instead of the Soy.FireFly package command:

dotnet add path/to/Contest.csproj reference path/to/FireFly/FireFly.csproj

Source-expanded submission

A contest program uses FireFly as an ordinary library:

using System;
using FireFly.Graph;

SourceExpander.Expander.Expand();

Graph<Directed, NoWeight> g = new(4, 3);
g.AddEdge(0, 1);
g.AddEdge(0, 2);
g.AddEdge(2, 3);

int[]? order = g.TopoSort();
Console.WriteLine(string.Join(" ", order!));

The contest project must reference both FireFly and the SourceExpander generator. Build or run it, then submit the generated Combined.csx. SourceExpander appends the required FireFly source to that file, so the judge does not need the FireFly DLL.

What is included

  • General algorithms such as binary search, longest increasing subsequence, coordinate compression, and sliding-window maxima.
  • Data structures including Fenwick trees and ordered maps.
  • Directed and undirected adjacency-list graphs, topological sorting, and shortest-path algorithms.
  • Buffered input and output for contest programs.
  • Bit-mask, array, and dictionary helpers.
  • Modular combinatorics and polynomial algorithms built around ac-library-csharp types.

The FireflyTest project provides the repository's smoke and regression checks and exercises SourceExpander generation.

Compatibility

FireFly targets net9.0 and sets the source-language baseline to C# 13. Generated source is intended for the current C# environments on Codeforces, AtCoder, and Library Checker; check a judge's active language version before submitting. Native AOT compatibility is not currently promised.

Build and test

From the repository root:

dotnet build FireFly.sln -c Release -p:GeneratePackageOnBuild=false
.\test.ps1

License and acknowledgements

FireFly is distributed under the MIT License.

The library depends on ac-library-csharp, whose core library source is released under CC0 1.0, and uses SourceExpander for single-file generation. See Third-Party Notices for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.1 0 8/19/2026