This page contains some of the tools I use when solving
UVa problems. If you
experience problems, please email me, and I'll fix things.
My gmail.com email address starts with "abednego".
If you have an idea for a useful script, please tell me.
I'll write it if I have time.
January 5, 2006 12:03
UVa is undergoing some major interface changes. As a result, all of my scripts
(except for grep+) are broken. I'm not sure when I'll be able to fix them. UVa
is still changing, and it's missing some key pages that I need (like the user
ranklist). Hopefully, at some point, I'll finally get access to their database
and be able to port the scripts to the UVa website.
On the other hand, the problem volumes now show more useful difficulty ratings
for each problem, so you should be able to find easy (or hard) problems without
September 8, 2006 22:21
The people at my old provider (NetBunch.com)
say they got hacked and lost all of their hosted websites and their backups.
A great finish to several months of "outstanding service". Finally I had more
than enough reasons to move shygypsy.com to a new host. Now, I'm trying to
restore everything back to normal. Some of the scripts are working right now,
but not all of them. I will need a couple of days to get all of my solved
problems together to fire up grep+, and the rankings are not updating yet
(working on that right now). My code library and
A to craZy are up. The rest is coming back soon. Sorry for
the delay; my own backups are a little disorganized and scattered over several
August 4, 2006 02:19
I'm playing around with some better ways of ranking people
and problems. Here is a preview
of a prototype. I have also discovered that I can easily
write CGI scripts in C++. Perl is great, but I can get
stuff done a hundred times faster in C++.
A to craZy
July 16, 2006 03:30
If you are bored, here is a little puzzle
for you. There may be a prize for the first person who
More broken scripts
June 18, 2006 13:49
For the past few weeks, the author and country ranklists have not
been updated. The bug is now fixed, and Japan has passed Canada!
I better solve some problems.
March 15, 2006 17:38
I am having some problems updating the database behind the
scripts. As a result, most of the scripts are broken right
now. Please be patient as I figure out what is going on...
Update: It seem that the problem was that I ran out
of disk space. Everything is back up now.
Graph Lovers' Contest 2006
January 16, 2006 20:22
My next Graph Lovers' Contest will take place on January 23,
14:00-19:00 EST (Eastern Standard Time) on the
UVa judge. There is
a prize of $100 to the first person or team to solve
all 8 problems.
On a related note, it seems that I might get a chance to
integrate my scripts with UVa's website, so that they will
not have to be limited to the top 2000 users and will be
updated instantly instead of hourly. Stay tuned for more
January 13, 2006 12:31
I have increased the database to store information on the top
2000 users now. Things seem to be working smoothly, and there is
almost no noticeable increase in the network load I'm generating
on the UVa website, so I think I'll stick with 2000 for now. Of
course, the change made an impression on the countries and problems
ranklists. Problem 100 is once again ranked as the easiest problem
(which is wrong, by the way). I find it absolutely amazing that
Bangladesh has 350 members in the top 2000.
From 1000 to 2000
January 11, 2006 11:51
The uvadb scripts are working very well, and I don't seem
to be bothering UVa much in terms of traffic. I will try to
gradually increase the number of scanned authors from 1000 to
2000 and see what happens. I think that the problem stats and
country rankings will benefit. Right now, only users who have
solved over 200 problems are considered. After I go up to 2000,
anyone with 113 problems or more will be counted.
January 4, 2006 14:24
Country rankings are here. See the link on the left hand side. I'm using
the TopCoder formula due to
Christopher Hendrie. Countries with fewer than 10 members are not
displayed. On a related note, you can now filter the authors ranklist
by country name. Just click on one of the countries in the country
ranklist and look at the URL to see how it's done. If you need to look
up a country code, here they are.
The old authors ranklist
January 4, 2006 00:46
Are you annoyed that you can no longer see the authors' names
in the UVa ranklist? Here is an alternative.
It shows (only) the top 1000 users and is updated once an hour. Stay
tuned for new features like being able to select users from a particular
country. Country rankings are not far behind.
The uvadb scripts
January 3, 2006 17:23
The new problem rankings are based on my newest creation that I call
uvadb. It is a collection of scripts that run once every hour
to update a number of plain text files that contain a copy of the more
interesting parts of UVa's database. Each of the files is a collection
of records, each one consisting of a number of tab-separated fields on
a line. Here is what I have so far.
probs.txt contains all of the problems,
sorted by problem number. The fields are
This data is parsed from the problem volumes.
- Problem number
- Checkmark colour - r (default), y (special judge) or w (unavailable)
- Number of submissions made
- Percentage of those submissions that got a Yes response
- Problem title
authors.txt contains information about
the top 1000 authors, sorted by their position in the ranklist. The
This data comes from scanning the individual users' pages.
- User ID
- Country (2 letters)
- Register date
- Last submission
- Presentation Error
- Wrong Answer
- Runtime Error
- Time Limit Exceeded
- Memory Limit Exceeded
- Output Limit Exceeded
- Compile Error
- Restricted Function
- Problems solved
solved.txt contains, for each user, the
list of problems they solved. The first field is the user ID, and
the remaining fields are the problems in increasing order. The
lines are sorted in the ranklist order. This data also comes from
the users' pages.
New problem rankings
January 3, 2006 (evening)
Both next2solve and diff+ have been fixed. They
are now using my own new problem ranking system. It's extremely
simple and seems to work quite well. The problem
rankings seem to resemble Sebastian Urbaniak's quite closely.
Here is how the ranking works. Each problem is assigned a simplicity
score (which appears in the last column of the table). To compute
the simplicity score of a problem, take the top 1000 people from the
ranklist. For each of those people who have solved that problem, divide
one by the number of problems solved by that person. Add up all of these
reciprocals. The sum is the problem's simplicity score. When displaying,
the scores are multilied by 100000 and rounded. I'm looking for
better ideas, so if you have one, please share it with me.
January 3, 2006 (afternoon)
The biggest fan of next2solve was Sergi Garcia Barea,
accessing it 2542 times. Sergi was followed closely by David
Courteaux and Joaquin Planells, both with over 2000 hits.
The most popular grep+ search query was "dp", which
was typed in 1614 times. "medium.*dp" and "easy" took 2nd
and 3rd place respectively. The prize for the most
impressive query goes to "medium.*(floyd-warshall|dijkstra|graph|prim)".
The kings of diff+ this month were Porsche Lam and Stephen
Lai, with Stephen appearing in both 1st and 3rd
place, the latter in comparison to Tak Keung Wong.
Finally, BigInt.cpp was the most
popular code library download (1090 hits).
A taste of things to come
January 3, 2006 (morning)
Big changes are coming... My next project is called uvadb. It is an
attempt to map most of UVa's database here and make it available for easy
access by scripts. So far, I have the problem stats,
author info and solution map
(who solved what) for the 1000 top ranked authors. All of this information is
updated hourly and is available in simple tab-separated format.
The main reason for this project is to redesign next2solve and diff+,
as they no longer show 5-digit problem numbers. This is because they rely on
Sebastian's script that is now broken. The next step is to create a
TopCoder-style country ranking and in the
words of Hatchet Harry's friend Barry the Baptist, "who knows what then."
... and "documentation" on how to use the scripts on the left hand side.
Searches my list of solved and attempted problems
for given keywords. For each problem, grep+
displays my difficulty ranking for the problem (trivial,
easy, medium or hard), algorithm and problem type keywords
(for example, "dp", "graphs", "number theory", etc) and
any comments I have about the problem (short, good, bad,
- Always use lower case, even for keywords like
"euler" and "dijkstra".
- Good keywords to try are: dp, graphs, bfs, dfs,
memoization, number theory, lcs, lis, shortest
path, dijkstra, floyd-warshall, flow, simulation,
- Search for "p" to get the complete list sorted
by modification time.
- You can search for a particular problem number.
- Input is a regular expression! This means that
if you are looking for easy graph problems, type
"easy.*graph", not "easy graph".
A simple extension of Sebastian Urbaniak's
ACM grading score list. Given a UVA user id, lists that
user's unsolved problems, sorted by increasing difficulty score.
How it works
The script first connects to UVA and gets your list of solved
problems. It then downloads the ranked problems list and filters it,
displaying only those problems that are not found in your list
of solved ones.
Displays the top500 list of people who solved a given UVa
problem, given the problem's number.
Takes two UVa user ID's and displays the list of problems solved by
user 1, xor user 2. The list is colour-coded and sorted by increasing
difficulty using Sebastian Urbaniak's
ACM grading score list.
How it works
The script first connects to UVA and gets the two lists of solved
problems. It then downloads the ranked problems list and filters it,
displaying only those problems that are found in exactly one of the
Rating problems by difficulty is a subjective matter. pVote
allows you to rate problems on their
- clarity: how easy is it to understand?
- difficulty: how difficult is it to solve?
- quality: are the problem statement and judge's solution correct?
Enter the problem number you are voting for (for example, 100).
Enter your UVa user ID (4 or 5 digits followed by 2 letters).
Select your ratings for the problem. Type in a few comments if you
wish, for example "bad input", "tricky cases", etc. Press "Vote".
Warning: Your ID will be stored in a file along with your
comments. If you do not want me to know your full ID, then you
should not vote. The ID is only used to prevent multiple voting.
To search by problem number, enter the problem number and press
"Search". To search by keywords, leave the problem field blank,
enter something into the Comments field and press "Search".
Searching by comments is done using a Perl regular expression, so if you
want to search by several keywords, type in "(keyword1|keyword2|...)",
without the quotes.