My Kattis page
Here are my entries for the Kattis problem Archive: https://open.kattis.com/.
My current rank and score: https://open.kattis.com/users/hakan-kjellerstrand (as of writing: Rank 1371 and Score 515.5)
Below are the entries in SWI-Prolog, Python3 and Ruby (as well as in Picat which - unfortunately - is not a langauge that's possible to select). At least one of the programs has an accepable solution, in term of output, speed and memory requirements.
For some problems, there are several variants and not all of them are accepted (some might be wrong which should be noted in the program); programs with a latter name tends to be faster or shorter. Most of the programs was written in January to March 2023, so some of the comments on the places in the Top 10 lists might be wrong. As can be seen in some the programs, I became more and more obsessed in getting as short programs as possible to get a place in the Top 10 list of the shortest programs, for example by compressing the programs; most files should have have an original "uncompressed" version as well.
Running the programs
For Python3, Ruby, and Picat, running the programs is quite easy: Just redirect the input file to the program, e.g
$ python3 backspace.py < backspace1.inp
b
For the SWI-Prolog programs it's a little messier. Here is how I run them:
$ swipl -O -q -g main -t halt -c backspace.pl && time a.out < backspace1.inp && echo "Exit status: $?"
b
a.out < backspace1.inp 0,02s user 0,00s system 98% cpu 0,024 total
Exit status: 0
Note that the SWI-Prolog version supported is v8.4.2 so some of the newer features in SWI-Prolog is not supported, for example some newer regex constructs.
The programs and the input examples
- ABC:
- a_different_problem:
- a_new_alphabet:
- a_real_challenge:
- aaah:
- acm:
- add_two_numbers:
- alien_numbers:
- alphabetspam:
- another_brick:
- apaxiaaans:
- apaxian_parent:
- arrangement:
- autori:
- average_character:
- avion:
- baby_bites:
- babylonian_numbers:
- backspace:
- bacon_eggs_and_spam:
- basketball_one_on_one:
- batter_up:
- bela:
- betting:
- bijele:
- birthday_memorization:
- booking_a_room:
- booking_a_room_dcg:
- bplan:
- breaking_branches:
- buka:
- bus:
- canadians_eh:
- card_trick:
- cetiri:
- cetvrta:
- chanukka_challenge:
- chanukka_challenge_dcg:
- charting_progress:
- cinema_crowds:
- cinema_crowds2_:
- class_field_trip:
- closing_the_loop:
- code_to_save_lives:
- coffee_cup_combo:
- cold_puter_science:
- compound_words:
- conformity:
- conundrum:
- costume_contest:
- count_the_vowels:
- counting_clauses:
- counting_clauses_back:
- course_scheduling:
- cprnummer:
- cut_in_line:
- das_blinkenlights:
- datum:
- death_knight_hero:
- delimeter_soup:
- detailed_differences:
- detailed_differences_dcg:
- dice_cup:
- dice_cup_dcg:
- dice_game:
- different_distances:
- digit_product:
- digitswap:
- disc_district:
- divvying_up:
- double_password:
- drm_messages:
- drunk_vigenere:
- early_winter:
- easiest:
- echo_echo_echo:
- election_paradox:
- election_paradox_cp:
- electricalcircuits:
- eligibility:
- eligibility_co:
- eligibility_eterms_shfr_co:
- encoded_message:
- erase_securely:
- espresso:
- estimating_the_area_of_a_circle:
- eulers_number:
- everywhere:
- exam:
- exam_cp:
- expected_earnings:
- eye_of_sauron:
- eye_of_sauron_dcg:
- faktor:
- falling_apart:
- fast_food_prizes:
- fifty_shades_of_pink:
- filip:
- final_exam:
- finding_an_a:
- fizzbuzz:
- flexible:
- fluortanten:
- forced_choice:
- free_food:
- friday_the_13th:
- fyi:
- gandalfs_spell:
- gcd:
- gcvwr:
- ghost_leg:
- grading:
- grass_seed:
- greetings:
- hailstone_sequences:
- hanging_out:
- hangman:
- harshad_numbers:
- haughty_cuisine:
- haypoints:
- head_guard:
- heart_rate:
- height_ordering:
- heimavinna:
- heirs_dilemma:
- helicentric:
- heliocentric:
- hello:
- help_a_phd:
- herman:
- hissing_microphone:
- hot_hike:
- howl:
- icpc_awards:
- imperial_measurement:
- interval_scheduling:
- is_it_halloween:
- jackolanternjuxtaposition:
- janitor_troubles:
job_expenses:
judging_moose:
jumbled_communication:
jumbo_javelin:
jumbo_javelin_dcg:
just_a_minute:
kafkaesque:
karte:
kattio:
kattutils:
kemija:
keylogger:
kleptography:
knight_packing:
knot_knowledge:
krizaljka:
ladder:
laptopsticker:
last_factorial_digit:
left_beehind:
license_to_launch:
lineup:
locust_locus:
luhn_checksum:
magic_trick:
marko:
math_homework:
messages_from_outer_space:
metaprogramming:
methodic_multiplication:
metronome:
mia:
mirror_images:
missing_numbers:
mixed_fractions:
mjehuric:
moderate_pace:
modulo:
moscow_dream:
mult:
n_sum:
nasty_hacks:
natrij:
nine_knights:
no_thanks:
nodup:
npuzzle:
number_fun:
odd_echo:
odd_gnome:
odd_man_out:
oddities:
oktalni:
one_chicken:
ostgotska:
overdraft:
owl_and_fox:
parking:
parking2_:
password:
patuljci:
paul_eigon:
peragrams:
permuted_arithmetic_sequence:
pervasive_heart_monitor:
pet:
piece_of_cake:
pig_latin:
pig_lating:
pizza_crust:
planina:
planting_trees:
pokechat:
poker_hand:
pot:
pot_dcg:
provinces_and_gold:
prsteni:
prva:
ptice:
pyramids:
qaly:
qaly_dcg:
quadrant:
quick_brown_fox:
quick_estimate:
r:
r2_:
radio_commercials:
rating_problems:
recount:
rectangle_area:
red_rover:
refrigerator:
reverse:
reverse_binary:
reverse_rot:
rijeci:
roaming_romans:
run_length_encoding_run:
saving_daylight:
saving_for_retirement:
saving_princess_peach:
scaling_recipe:
scaling_recipes:
school_spirit:
secret_message:
secure_doors:
server:
set:
seven_wonders:
shattered_cake:
shattered_cake_dcg:
shopping_list_easy:
sibice:
simon_says:
simone:
simple_addition:
simplearithmetic:
skocimis:
sky_islands:
slatkisi:
smil:
social_distancing:
social_running:
soda_slurper:
sok:
solving_for_carrots:
some_sum:
sort_of_sorting:
sort_two_numbers:
soylent:
spavanac:
speeding:
speedlimit:
speedlimit_dcg:
square_peg:
stacking_cups:
statistics:
stop_watch:
stuck_in_a_time_loop:
sum_kind_of_problem:
sum_squared_digits:
sun_and_moon:
symmetric_order:
t9_spelling:
tais_formula:
tajna:
take_two_stones:
tarifa:
tarifa_dcg:
test_drive:
tetration:
the_bus_card:
the_clock:
the_deal_of_the_day:
the_grand_adventure:
the_key_to_cryptography:
the_last_problem:
the_plank:
this_aint_your_grandpas_checkerboard:
title_cost:
tower_construction:
tracking_shares:
transit_woes:
tri:
triarea:
trik:
trip_odometer:
trip_odometer_gpt:
triple_texting:
turn_it_up:
two_sum:
ultimate_binary_watch:
unbearable_zoo:
unlock_patterm:
vauvau:
veci:
volim:
vote:
warehouse:
weak_vertices:
welcome_easy:
which_is_greater:
wizard_of_odds:
yin_yang_stones:
yin_yang_stones_gpt:
yoda:
zamka:
zanzibar:
zoom:
Last modified: Wed Aug 23 08:59:33 CEST 2023