コード例 #1
0
        public Codeforces()
            : base("codeforces")
        {
            var req = new ProblemsRequest();

            ProblemSet = req.GetProblemSetAsync().Result;
        }
コード例 #2
0
        public static async void GetSet()
        {
            var req = new ProblemsRequest();
            var res = await req.GetProblemSetAsync();

            foreach (var problem in res.Problems)
            {
                Console.WriteLine(problem.Name);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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();
        }