kuretchi / competitiveprogramming Goto Github PK
View Code? Open in Web Editor NEWLibrary for competitive programming in C#
License: Do What The F*ck You Want To Public License
Library for competitive programming in C#
License: Do What The F*ck You Want To Public License
var eq = new BigRational(0, 1) == new BigRational(0, 1);
明らかに実装の問題である
CompetitiveProgramming/CompetitiveProgramming/Math/BigRational.cs
Lines 107 to 111 in 18b2fef
再現コードはない. なんかぶん回したときにたまに出た
new[] { 1, 2, 3, 4, 5 }.UpperBound(5); // expect 5, but 2
new[] { 1 }.UpperBound(0); // 0
new[] { 1 }.UpperBound(1); // expect 1, but IndexOutOfRangeException
GetObservableEntries
は GetEntriesAsObservable
の方が良いかもしれない.
非可換モノイドを載せるとうまく動作しないことが分かる
struct Monoid : IMonoid<string>
{
public string Unit => "";
public string Append(string left, string right) => left + right;
}
struct Operator : IBinaryOperator<string, string, string>
{
public string Operate(string left, string right) => left + right;
}
var lst = new LazySegmentTree<string, Monoid, string, Monoid, Operator>(10);
lst[0, 3].Apply("hoge");
lst[1, 4].Apply("piyo");
for (var i = 0; i < lst.Length; i++)
Console.Write($"{lst[i].Concat()}, ");
// expected: "hoge, hogepiyo, hogepiyo, hogepiyo, piyo, , , , , "
// actual: "hoge, hogepiyo, piyohoge, piyohoge, piyo, , , , , "
var ft = new FenwickTree<int, SumGroup_Int32>(new[] { 3, 1, 4, 1, 5, 9, 2, 6, 5 });
再現コード
var cc = new CoordinateCompressor<int>(new[] { 3, 1, 4 });
cc.Compress(3); // 1
cc.Compress(1); // expect 0, but actually KeyNotFoundException
cc.Compress(4); // 2
cc.Decompress(0); // 1
ユニークじゃなければ大丈夫
var cc = new CoordinateCompressor<int>(new[] { 3, 1, 4, 1 });
cc.Compress(1); // 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.