2009-12-03から1日間の記事一覧

C#でC++のstd::pair

C#

What is C# analog of C++ std::pair?(Stack Overflow)より public class Pair<T, U> { public Pair() { } public Pair(T first, U second) { this.First = first; this.Second = second; } public T First { get; set; } public U Second { get; set; } }; ふむふ</t,>…

SRM 451 DIV2 Level.2

問題文を理解するのに時間がかかってしまった。 感覚で英語読んで、読み飛ばしとかしてるからこうなるんだよな・・・。 using System; using System.Collections.Generic; using System.Text; public class BoredPhilosophers { public int[] simulate(Strin…

SRM 451 DIV2 Level.1

簡単。 using System; using System.Collections.Generic; using System.Text; public class ReverseMagicalSource { public int find(int source, int A) { int ans = 0; int tmp = 1; while (ans <= A) { ans += source * tmp; tmp *= 10; } return ans; }…