File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -528,8 +528,8 @@ def scrape_problem(self):
528528 Method to scrape a single problem from codeforces
529529 """
530530 print 'Fetching problem ' + self .contest + '-' + self .problem + ' from Codeforces...'
531- url = 'http://codeforces.com/ contest/' + \
532- self . contest + '/ problem/' + self .problem
531+ type = 'contest' if int ( self . contest ) <= 100000 else 'gym'
532+ url = 'http://codeforces.com/%s/%s/ problem/%s' % ( type , self .contest , self . problem )
533533 req = Utilities .get_html (url )
534534 inputs , outputs = self .parse_html (req )
535535 Utilities .store_files (self .site , self .contest ,
@@ -541,7 +541,8 @@ def scrape_contest(self):
541541 Method to scrape all problems from a given codeforces contest
542542 """
543543 print 'Checking problems available for contest ' + self .contest + '...'
544- url = 'http://codeforces.com/contest/' + self .contest
544+ type = 'contest' if int (self .contest ) <= 100000 else 'gym'
545+ url = 'http://codeforces.com/%s/%s' % (type , self .contest )
545546 req = Utilities .get_html (url )
546547 links = self .get_problem_links (req )
547548
You can’t perform that action at this time.
0 commit comments