jonsteinn / kattis-solutions Goto Github PK
View Code? Open in Web Editor NEWSolutions to the Kattis archives
License: GNU General Public License v3.0
Solutions to the Kattis archives
License: GNU General Public License v3.0
can you explain your code
I have a very similar Pythonic solution to red rover (https://open.kattis.com/problems/redrover) by iterating over sub-lists, dynamically keeping track of the macro encoding. However, my solution failed with a "WA" message failing on the 7/38 test case and I just couldn't figure out why.
Is your solution able to successful pass all the test cases on Kattis?
route = input()
macroed = 0
for i in range(2, int(len(route)/2) + 1):
for n in range(len(route) - i + 2):
# if in rest of the route
if route[n:n+i] in (route[1:n-1] + route[n+i:]):
macroed = i
break
if macroed == 0:
print(len(route))
else:
print(len(route) - macroed + 1)
How were you able to write such a nicely formatted and clean looking readme.md? Did you manually add each problem (along with its link) or did you use crawler code to scrap Kattis in some way?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.