A guy with a lot of useful things to do when doing AtCoder in Python

Overview

atcoder_python_env

Python で AtCoder をやるときに便利な諸々を用意したやつ

必要なモジュールのインストール

online-judge-toolsatcoder-cli を使います

$ pip3 install -r requirements.txt
$ npm install -g atcoder-cli

コンテスト用フォルダの作成

例えば下記コマンドで abc/abc100 フォルダが作成されます

$ python3 build_contest_env.py abc/abc100

階層は以下のようになります

.
├── abc
│   └── abc100
│       ├── a.py
│       ├── b.py
│       ├── c.py
│       ├── d.py
│       ├── e.py
│       ├── f.py
│       ├── g.py
│       ├── h.py
│       ├── judge.py
│       ├── setup.py
│       └── submit.py
├── temp
│   ├── judge.py
│   ├── setup.py
│   ├── submit.py
│   └── temp.py
├── .gitignore
├── README.md
├── build_contest_env.py
└── requirements.txt

a.py ~ h.py がそれぞれの問題を解くためのファイルで、 temp/temp.py の内容をコピーしたものです。なので自分のテンプレファイルを使いたい場合は temp/temp.py を変更してください

なお、フォルダ名は自由で大丈夫ですが、セットアップの際にフォルダのパスの末尾をデフォルトのコンテストIDとして認識するように設定してあるので末尾はコンテストIDにしておくと便利です

オプションがいくつかあるので詳しくは下記コマンドによりヘルプを参照してください

$ python3 build_contest_env.py -h

セットアップ

セットアップでは全問題のサンプルケースのダウンロードと自動テスト・自動提出のための設定を行います

自動テストと自動提出を行う前に必ず実行してください

上記で作成したディレクトリに移動します

$ cd abc/abc100

下記コマンドによりセットアップを行います

$ python3 setup.py -c abc100

-c オプションによりコンテストIDを指定します

なおデフォルトではカレントディレクトリの末尾をコンテストIDと認識するようになっているので、今回の例では下記コマンドでも大丈夫です

$ python3 setup.py

初回実行時は自動テスト・自動提出のために online-judge-tools と atcoder-cli のそれぞれから AtCoder にログインするため2回続けてログインを要求します

2回目の実行以降はログインなしで実行可能です

自動テスト

abc/abc100 ディレクトリにおいて、例えば下記コマンドにより A 問題のサンプルケースを自動でテストします

$ python3 judge.py a

-s オプションをつけて実行するとサンプルが全て一致していたら自動で提出も行います

$ python3 judge.py a -s

他にもオプションがいくつかあるので詳しくは下記コマンドによりヘルプを参照してください

$ python3 judge.py -h

自動提出

abc/abc100 ディレクトリにおいて、例えば下記コマンドにより A 問題に自動で提出します

$ python3 submit.py a

-l オプションにより pypy で提出するか python で提出するか選べます、デフォルトは pypy です

$ python3 submit.py a -l python

詳しくは下記コマンドによりヘルプを参照してください

$ python3 submit.py -h
A Company Management System For Python

campany-management Getting started To make it easy for you to get started with GitLab, here's a list of recommended next steps. Already a pro? Just ed

hatice akpınar 3 Aug 29, 2022
🦋 hundun is a python library for the exploration of chaos.

hundun hundun is a python library for the exploration of chaos. Please note that this library is in beta phase. Example Import the package's equation

kosh 7 Nov 07, 2022
Comprehensive OpenAPI schema generator for Django based on pydantic

🗡️ Djagger Automated OpenAPI documentation generator for Django. Djagger helps you generate a complete and comprehensive API documentation of your Dj

13 Nov 26, 2022
A pure-Python codified rant aspiring to a world where numbers and types can work together.

Copyright and other protections apply. Please see the accompanying LICENSE file for rights and restrictions governing use of this software. All rights

Matt Bogosian 28 Sep 04, 2022
Password manager using MySQL and Python 3.10.2

Password Manager Password manager using MySQL and Python 3.10.2 Installation Install my-project with github git clone https://github.com/AyaanSiddiq

1 Feb 18, 2022
PythonKafkaCompose is an upgrade of the amazing work done in liveMaps

PythonKafkaCompose is an upgrade of the amazing work done in liveMaps It is a simple project composed by: an instance of Kafka a Py

5 Jun 19, 2022
A program that lets you use your tablet's tilting to emulate an actual joystick on a Linux computer.

Tablet Tilt Joystick A program that lets you use your tablet's tilting to emulate an actual joystick on a Linux computer. It's called tablet tilt joys

1 Feb 07, 2022
Jannik Ramrath 1 Feb 05, 2022
Modelling the 30 salamander problem from `Pure Mathematics` by Martin Liebeck

Salamanders on an island The Problem From A Concise Introduction to Pure Mathematics By Martin Liebeck Critic Ivor Smallbrain is watching the horror m

Faisal Jina 1 Jul 10, 2022
This is a Saleae Logic custom high level analyzer that allows you to search and mark specific packets.

SaleaePacketParser This is a Saleae Logic custom high level analyzer that allows you to search and mark specific packets. Field "Search For" is used f

1 Dec 16, 2021
A telegram bot which programed to countdown.

countdown-vi this is a telegram bot which programed to countdown. usage well, first you should specify a exact interval. there is 5 column, very first

Arya Shabane 3 Feb 15, 2022
A random cat fact python module

A random cat fact python module

Fayas Noushad 4 Nov 28, 2021
A collection of useful functions for writers to analyze text/stories.

AuthorTools AuthorTools provides a multitude of functions for easily analyzing (your?) writing. AuthorTools is made especially for creative writers wi

1 Jan 14, 2022
This is a database of 180.000+ symbols containing Equities, ETFs, Funds, Indices, Futures, Options, Currencies, Cryptocurrencies and Money Markets.

Finance Database As a private investor, the sheer amount of information that can be found on the internet is rather daunting.

Jeroen Bouma 1.4k Dec 31, 2022
Blender Add-on to Add Metal Materials to Your Scene

Blender QMM (Quick Metal Materials) Blender Addon to Add Metal Materials to Your Scene Installation Download the latest ZIP from Releases. Usage This

Don Schnitzius 27 Dec 26, 2022
The only purpose of a byte-sized application is to help you create .desktop entry files for downloaded applications.

Turtle 🐢 The only purpose of a byte-sized application is to help you create .desktop entry files for downloaded applications. As of usual with elemen

TenderOwl 14 Dec 29, 2022
CRC Reverse Engineering Tool in Python

CRC Beagle CRC Beagle is a tool for reverse engineering CRCs. It is designed for commnication protocols where you often have several messages of the s

Colin O'Flynn 51 Jan 05, 2023
Nextstrain build targeted to Omicron

About This repository analyzes viral genomes using Nextstrain to understand how SARS-CoV-2, the virus that is responsible for the COVID-19 pandemic, e

Bedford Lab 9 May 25, 2022
Solcast Integration for Home Assistant

Solcast Solar Home Assistant(https://www.home-assistant.io/) Component This custom component integrates the Solcast API into Home Assistant. Modified

Greg 45 Dec 20, 2022
Mini-calculadora escrita como exemplo para uma palestra relâmpago sobre `git bisect`

Calculadora Mini-calculadora criada para uma palestra relâmpado sobre git bisect. Tem até uma colinha! Exemplo de uso Modo interativo $ python -m calc

Eduardo Cuducos 3 Dec 14, 2021