<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://cs1.utm.edu/icpc/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://cs1.utm.edu/icpc/feed.php">
        <title>UT Martin Competitive Programming Guidebook python3</title>
        <description></description>
        <link>http://cs1.utm.edu/icpc/</link>
        <image rdf:resource="http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-03T02:55:26+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:input&amp;rev=1534369248&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:input_output&amp;rev=1534291485&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:list&amp;rev=1534443488&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:output&amp;rev=1534368780&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:unpacking&amp;rev=1533830434&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico">
        <title>UT Martin Competitive Programming Guidebook</title>
        <link>http://cs1.utm.edu/icpc/</link>
        <url>http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:input&amp;rev=1534369248&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-08-15T16:40:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:input</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:input&amp;rev=1534369248&amp;do=diff</link>
        <description>Input in Python3

There is no magic bullet that leads to the fastest input and output in a programming contest. In particular, when the fastest possible source is needed competitors will have little choice but to go with C++ or Java.

Having said this, there are typically multiple ways of performing and processing input and output in Python3. By understanding the options that are available and how to optimize them (e.g., conducting tests) you can see a real world performance increase, in particu…</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:input_output&amp;rev=1534291485&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-08-14T19:04:45+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:input_output</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:input_output&amp;rev=1534291485&amp;do=diff</link>
        <description>Input and Output

There is no magic bullet that leads to the fastest input and output in a programming contest. Having said this, there are typically multiple ways of performing and processing input and output in Python3. By understanding the options that are available and how to optimize them (e.g., conducting tests) you can see a real world performance increase, in particular when faced with high volumes of reads and writes.</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:list&amp;rev=1534443488&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-08-16T13:18:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:list</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:list&amp;rev=1534443488&amp;do=diff</link>
        <description>Python3 Lists</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T16:19:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:list_comprehensions</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff</link>
        <description>List Comprehensions

List comprehensions are used for creating lists from existing lists and other iterable structures. List comprehensions typically follow formatting similar to set-builder notation in discrete mathematics.

Syntax

Consider the following illustrative Python3 example for generating a list of squares:</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T12:43:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:lru_cache</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff</link>
        <description>LRU Cache

Memoization is a common optimization technique where repeatedly computed values are cached for quick lookup. While memoization can be achieved by a relatively simple modification to many recursive formulations, Python3's functools library implements automatic memoization in the form of an LRU (least recently used) cache as a</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:output&amp;rev=1534368780&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-08-15T16:33:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:output</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:output&amp;rev=1534368780&amp;do=diff</link>
        <description>Output in Python3

There is no magic bullet that leads to the fastest input and output in a programming contest. Having said this, there are typically multiple ways of performing and processing input and output in Python3. By understanding the options that are available and how to optimize them (e.g., conducting tests) you can see a real world performance increase, in particular when faced with high volumes of reads and writes.</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T16:48:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:priority_queue</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff</link>
        <description>Python3 Priority Queues

Insertion &amp; Removal


import queue

q = queue.PriorityQueue()
q.put(10)
q.put(1)
q.put(5)
while not q.empty():
    print(q.get())    # 1 5 10


Modifying Priority

Unlike C++ and Java, the standard priority queue in Python3 does not take a comparator on declaration. There are two means of dealing with a modified priority or a priority that is separate from the object:</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T13:10:46+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:recursion_depth</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff</link>
        <description>Recursion Depth Limits

Factorial

The factorial function is a canonical recursive example. Factorial has a convenient recursive definition as n! = n * (n -- 1)! where 0! = 1! = 1.

The following is a standard implementation derived from this definition:


def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

print(factorial(997))</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:unpacking&amp;rev=1533830434&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-08-09T11:00:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python3:unpacking</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:unpacking&amp;rev=1533830434&amp;do=diff</link>
        <description>Unpacking Sequences

Sequences can be explicitly/implicitly unpacked into discrete, ordered units of some type. Unpacking happens automatically using the , (comma). (The syntax is also used for Tuple construction.)

Unpacking works only in instances where the number of variables used</description>
    </item>
</rdf:RDF>
