public Codeforces() : base("codeforces") { var req = new ProblemsRequest(); ProblemSet = req.GetProblemSetAsync().Result; }
public static async void GetSet() { var req = new ProblemsRequest(); var res = await req.GetProblemSetAsync(); foreach (var problem in res.Problems) { Console.WriteLine(problem.Name); } }
private void LoadContestsFromFile() { //Call when contests update. //TODO::Call somewhere else. Globals.ContestsProblemsList = new Dictionary <int, List <Problem> >(); //ParseWebPages(); var req2 = new ProblemsRequest(); Globals.ProblemSet = req2.GetProblemSetAsync().Result; Globals.ContestsProblemsList = new JavaScriptSerializer(). Deserialize <Dictionary <string, List <Problem> > >(File.ReadAllText("contests.txt")) .ToDictionary(k => int.Parse(k.Key), v => v.Value); }
static void Main(string[] args) { var req = new ProblemsRequest(); var c = req.GetProblemSetAsync().Result; foreach (var p in c.Problems) { if (p.Name.ToLower().Contains("god")) { Console.WriteLine(p.Name); } } Console.Read(); }