/// <summary>
        /// 返回指定比赛的提交(可以返回指定用户的提交)
        /// </summary>
        /// <param name="contestId">比赛 ID</param>
        /// <param name="handle">用户 ID</param>
        /// <param name="from">起始索引</param>
        /// <param name="count">返回条目</param>
        /// <returns>返回 JSON(JObject) 格式的提交列表,按提交 ID 递减顺序排序</returns>
        public async Task <JObject> GetContestStatusAsync(int contestId, string handle = null, int from = -1, int count = -1)
        {
            try
            {
                var jsonData = await HttpClientSingleton.DoGetAsync(GetContestStatusUrl(contestId, handle, from, count));

                return((JObject)JsonConvert.DeserializeObject(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 查询比赛列表
        /// </summary>
        /// <param name="gym">是否显示 GYM 的比赛</param>
        /// <returns>返回 JSON(JObject) 格式的比赛列表</returns>
        public async Task <JObject> GetContestListAsync(bool gym = false)
        {
            try
            {
                var jsonData = await HttpClientSingleton.DoGetAsync(GetContestListUrl(gym));

                return((JObject)JsonConvert.DeserializeObject(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 查询 Codeforces 指定比赛的榜单
        /// </summary>
        /// <param name="contestId">比赛 ID</param>
        /// <param name="showUnofficial">是否显示非官方数据</param>
        /// <param name="from">起始索引</param>
        /// <param name="count">返回条目</param>
        /// <param name="handles">查询的用户 ID,多个的话中间用分号分隔</param>
        /// <param name="room">房间号</param>
        /// <returns>返回 JSON(JObject) 格式的比赛榜单</returns>
        public async Task <JObject> GetContestStandingsAsync(int contestId, bool showUnofficial = false, int from = -1, int count = -1, string handles = null, int room = -1)
        {
            try
            {
                var jsonData = await HttpClientSingleton.DoGetAsync(GetContestStandingsUrl(contestId, showUnofficial, from, count, handles, room));

                return((JObject)JsonConvert.DeserializeObject(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 返回问题集中的所有问题,可以通过标签进行过滤。
        /// </summary>
        /// <param name="tags">标签</param>
        /// <returns>返回 JSON(JObject) 格式的问题列表</returns>
        public async Task <JObject> GetProblemSetProblemsAsync(string tags = null)
        {
            try
            {
                var getParams = new Dictionary <string, string>();
                if (tags != null)
                {
                    getParams.Add("tags", tags);
                }
                var jsonData = await HttpClientSingleton.DoGetAsync(PROBLEMSET_PROBLEMS_URL, getParams);

                return((JObject)JsonConvert.DeserializeObject(jsonData));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 根据竞赛 ID 以及提交 ID 查询代码内容
        /// </summary>
        /// <param name="contestId">竞赛 ID</param>
        /// <param name="submissionId">提交 ID</param>
        /// <param name="language">返回所使用的编程语言</param>
        /// <returns>返回指定 ID 的提交代码</returns>
        public async Task <Dictionary <string, string> > GetCodeBySubmissionIdAsync(int contestId, int submissionId)
        {
            try
            {
                var url  = string.Format(CONTEST_SUBMISSION_URL, contestId, submissionId);
                var html = await HttpClientSingleton.DoGetAsync(url);

                var parser   = new HtmlParser();
                var document = parser.Parse(html);
                var preCode  = document.QuerySelector("pre");
                var handle   = document.QuerySelector("#pageContent table td a").TextContent;

                var dictionary = new Dictionary <string, string>();
                dictionary.Add("code", document.QuerySelector("pre").TextContent);
                dictionary.Add("language", preCode.ClassName.Split()[1].Trim());
                dictionary.Add("handle", handle);
                return(dictionary);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }