Skip to content

rHermes/contests

Repository files navigation

Contests

These are various programming contests that I've solved. When I can, I try to solve these in C, but if it requires something like a set, I'll go for C++ in most situations, since a proper set implementation takes a lot of code, and C++ has builtin versions.

Gold gems:

Various datastructures: - [[http://codeforces.com/blog/entry/15729]]

Status

Leetcode

This is the place I find task the most these days, and where I have most solved tasks. As of 2024-10-21 I have all tasks here, and there are 504 of them. I am working on a tool to plot average execution time compared to other solutions.

There are some tasks that have alternate solutions, which are cool or unusual in some way. These will have a lXXX_YYY.cpp name, and to avoid counting them when checking, we use the following command:

tokei -e '*_*.cpp'

https://leetcode.com/u/teodor_spaeren/

Kattis

https://open.kattis.com/users/rhermes

Problem Language Status CPU Clues
Hello World! C Accepted 0.00 No
I've Been Everywhere, Man C++ Accepted 0.00 No
Pot C Accepted 0.00 No
Texture Analysis C Accepted 0.02 No
Sibice C Accepted 0.00 No
Skener C Accepted 0.00 No
Prsteni C Accepted 0.00 No
Zbrka C Accepted 0.07 Yes
Ispiti C++ Time Limit Exceeded No

Codeforces

http://codeforces.com/profile/rHermes

Problem Language Status Time Memory
13E - Holes c Accepted 654ms 3400 KB

DMOJ

https://dmoj.ca/user/solace

Code Name Language Points Status Time Memory
tle16c6j1 TLE '16 Contest 6 (Mock CCC) J1 - Paper Printing C11 4/4 15/15 0.29 992.0 KB
ichb2017p2 ICHB Selection Contest '17 Problem 2 - Black Star's Visit C++20 7/7 100/100 0.165 16.69 MB
ichb2017p3 ICHB Selection Contest '17 Problem 3 - Parallel Universe C++20 12/12 100/100 1.02 4.2 MB
aplusb2 A Plus B (Hard) C++20 12/12 935/935 0.228 3.25 MB
tle17c4p3 TLE '17 Contest 4 P3 - Fax's Christmas Dish C++20 7/7 100/100 1.611 4.86 MB
tle17c3p6 TLE '17 Contest 3 P6 - Donut Coupons C++20 25/25 100/100 4.370 12.68 MB
nwerc11c ICPC NWERC 2011 C - Movie Collection C++20 10/10 2/2 0.076 4.39 MB
nwerc11a ICPC NWERC 2011 A - Binomial Coefficients C++20 10/10 2/2 0.009 3.06 MB
aac1p1 An Animal Contest 1 P1 - Alpaca Shapes C++20 3/3 100/100 0.068 1.54 MB
aac1p2 An Animal Contest 1 P2 - Alpaca Racing C++20 5/5 100/100 2.430 10.82 MB
mathp1 A Math Contest P1 - Arrays C++20 5/5 100/100 0.057 1.52 MB
mathp2 A Math Contest P2 - Subsequence Sum C++20 5/5 100/100 0.442 1.43 MB
mathp3 A Math Contest P3 - LIS Reconstruction C++20 7/7 100/100 0.660 15.64 MB
mathp5 A Math Contest P5 - Good Arrays C++20 7/7 100/100 0.660 15.64 MB

Nice ones

  • nwerc11a: Here I had to google to figure it out, but I learned a lot and I think my writeup is really nice.
  • nwerc11c: This is the task where I learned about Fenwick trees, which was really cool.
  • mathp1: This turns out to have a really cool solution with a GCD.
  • mathp2: This has a really cool solution for subsquence sums.
  • mathp5: AWESOME TASK! The solutions here are varied and I really learned a lot doing it!
  • yac8p4: My first time encountering an interactive task! Really cool one.
  • yac8p5: My first time seeing a "run twice task", and it has such an awesome solution!

Timus

http://acm.timus.ru/author.aspx?id=246961

Number Name Language Status Time Memory
1000 A+B Problem c Accepted 0.001 204 KB
1001 Reverse Root c Accepted 0.124 1248 KB
1002 Phone Numbers c Accepted 0.031 752 KB
1003 Parity cpp Accepted 0.062 952 KB
1004 Sightseeing Trip c Accepted 0.031 288 KB
1005 Stone Pile c Accepted 0.015 224 KB
1006 Square Frames c Accepted 0.015 212 KB
1007 Code Words c Accepted 0.265 212 KB
1008 Image Encoding cpp Accpeted 0.015 284 KB
1009 K-based Numbers c Accepted 0.001 212 KB
1010 Discrete Function c Accepted 0.031 208 KB
1011 Conductors c Accepted 0.015 204 KB
1012 K-based Numbers. Version 2 c Accepted 0.015 208 KB
1013 K-based Numbers. Version 3 c Accepted 0.015 232 KB
1014 Product of Digits c Accepted 0.015 208 KB
1015 Test the Difference! c Accepted 0.015 344 KB
1016 Cube on the Walk cpp Accepted 0.001 448 KB
1017 Staircases c Accepted 0.001 336 KB
1018 Binary Apple Tree c Accepted 0.001 304 KB
1019 Line Painting c Accepted 0.062 520 KB
1020 Rope c Accepted 0.001 244 KB
1021 Sacrament of the Sum c Accepted 0.031 260 KB
1022 Genealogical Tree cpp Accepted 0.001 300 KB
1023 Buttons c Accepted 0.015 204 KB
1024 Permutations c Accepted 0.001 208 KB
1025 Democracy in Danger c Accepted 0.001 208 KB
1026 Questions and Answers c Accepted 0.031 228 KB
1027 D++ Again c Accepted 0.001 176 KB
1028 Stars c Accepted 0.015 376 KB
1029 Ministry c Accepted 0.015 652 KB
1030 Titanic c Accepted 0.001 240 KB
1031 Railway Tickets c Accepted 0.280 896 KB
1031 Railway Tickets cpp Accepted 0.015 628 KB
1032 Find A Multiple c Accepted 0.015 312 KB
1033 Labyrinth c Accepted 0.001 220 KB
1034 Queens in Peaceful Positions c Accepted 0.001 192 KB
1036 Lucky Tickets c Accepted 0.046 236 KB
1037 Memory Management c Accepted 0.795 328 KB
1038 Spell Checker c Accepted 0.015 328 KB
1039 Anniversary Party c Accepted 0.001 516 KB
1040 Airline Company c Accepted 0.001 236 KB
1041 Nikifor cpp Accepted 0.125 1380 KB
1042 Central Heating c Accepted 0.015 272 KB
1067 Disk Tree cpp Accepted 0.093 1756 KB
1068 Sum c Accepted 0.001 212 KB
1074 Very Short Problem c Accepted 0.015 200 KB
1100 Final Standings c Accepted 0.078 2560 KB
1110 Power c Accepted 0.001 204 KB
1185 Wall c Accepted 0.001 260 KB
1820 Ural Steaks c Accepted 0.015 208 KB
1877 Bicycle Codes c Accepted 0.001 192 KB

Nice ones.

  • 1003 - Parity
    • First time I have heard of or used a DSU. Slick way of solving the problem.
  • 1005 - Stone Pile
    • I read a reasearch paper on two-way partitioning to solve it.
  • 1015 - Test The Difference!
    • I really like how I do the rotation of the dice here and how I kind of hand unrolled the loop.
  • 1016 - Cube on the Walk
    • Nice implementation of A*
  • 1019 - Line painting
    • I implemented the damn datastructure myself, and I'm proud of it.
  • 1028 - Stars
    • First time I heard of Binary Index Tree. Cool datastructure.
  • 1032 - Find a Multiple
    • It has a nice mathematical proof behind it.
  • 1034 - Queens in Peaceful Positions
    • I rank high on this one, and it is a problem that seems impossible when starting, but turns out to be very possible.
  • 1074 - Very Short problem
    • I like that I managed to implement it in C, and using so little memory.
  • 1100 - Final Standings
    • First time I heard of counting sort.
  • 1185 - Wall
    • First time I encountered convex hull algorithms.
  • 1401 - Nikifor
    • It's fun when linear algebra AND modular arithmetic comes into play.
  • 1042 - Central Heating
    • I like it when linear algebra comes into places you would not expect it!

TODO

  • Make sure to understand everything about timus 1004
  • Refine p1074, to use less structures.
  • Redo Timus p1006 to not use stretch buffers.
  • Redo Timus p1037 to be faster. This may involve queues?

About

A repo of various contests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published