示例#1
0
def main(argv):
    #llistat = [341,343,346,348,351,354,356,360,364,367,372,375,377,380,383,388,403,406,407,414,418,420,425,429,434,438,442]; #Div1contests
    #llistat = [379, 436, 325, 316, 241] #Div1&2contests
    #llistat = [549]; #LookseryCup
    llistat = [
        447, 448, 450, 451, 454, 456, 459, 460, 462, 463, 465, 466, 467
    ]
    #Div2contests.
    f = open('Div2sft.txt', 'w')
    api = CodeforcesAPI()
    for id in llistat:
        llista = list(api.contest_standings(id)['rows'])
        participa = str(len(llista))
        for p in llista:
            tio = p.party.members[0].handle
            print(str(id) + ' ' + str(p.rank))
            concursos = api.user_rating(tio)
            cont = 0
            for c in concursos:
                cont = cont + 1
                if c.contest_id == id:
                    f.write(
                        str(c.rank) + ' ' + str(c.old_rating) + ' ' +
                        str(c.new_rating) + ' ' + participa + ' ' + str(cont) +
                        ' ' + str(id) + '\n')
示例#2
0
def main():
    api = CodeforcesAPI()

    ranklist = api.contest_standings(613, count=10000)
    ranklist_rows = list(ranklist['rows'])

    users = {u.handle: u for u in api.user_info(list(get_all_user_handles(ranklist_rows)))}

    print("Users from Ural FU:")
    for row in filter_by_organization(ranklist_rows, users, "Ural FU"):
        print('    {party}, points: {points}'.format(party=row.party, points=row.points))

    print()

    print("Users from Mexico:")
    for row in filter_by_country(ranklist_rows, users, "Mexico"):
        print('    {party}, points: {points}'.format(party=row.party, points=row.points))
示例#3
0
def main(argv):
    #llistat = [341,343,346,348,351,354,356,360,364,367,372,375,377,380,383,388,403,406,407,414,418,420,425,429,434,438,442]; #Div1contests
    #llistat = [379, 436, 325, 316, 241] #Div1&2contests
    #llistat = [549]; #LookseryCup
    llistat = [447,448,450,451,454,456,459,460,462,463,465,466,467]; #Div2contests.
    f = open('Div2sft.txt', 'w')
    api = CodeforcesAPI()
    for id in llistat:
        llista = list(api.contest_standings(id)['rows'])
        participa = str(len(llista))
        for p in llista:
            tio = p.party.members[0].handle
            print(str(id)+' '+str(p.rank))
            concursos = api.user_rating(tio)
            cont = 0
            for c in concursos:
                cont = cont+1
                if c.contest_id==id:
                    f.write(str(c.rank)+' '+str(c.old_rating)+' '+str(c.new_rating)+' '+participa+' '+str(cont)+' '+str(id)+'\n')
示例#4
0
def load_problems(contest_id):
    api = CodeforcesAPI()

    return api.contest_standings(contest_id, count=1)['problems']