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
Pokemon sword replay capture

pokemon-sword-replay-capture This is an old version (March 2020) pokemon-sword-replay-capture-mar-2020-version of my Pokemon Replay Capture software.

11 May 15, 2022
Final project in KAIST AI class

mmodal_mixer MLP-Mixer based Multi-modal image-text retrieval Image: Original image is cropped with 16 x 16 patch size without overlap. Then, it is re

SuperSuperMoon 5 May 30, 2022
This repository contains each day of Advent of Code 2021 that I've done.

Advent of Code - 2021 I will use this repository as my Advent of Code1 (AoC) repo for the 2021 challenge. I'm changing how I am tackling the problems

Brett Chapin 2 Jan 12, 2022
Rotating cube with hand

I am still working on this project :)) To-Do(Present): = It needs an algorithm to fine tune my hand's coordinates for rotation of our cube (initial o

Jay Desale 2 Dec 26, 2021
Open-source data observability for modern data teams

Use cases Monitor your data warehouse in minutes: Data anomalies monitoring as dbt tests Data lineage made simple, reliable, and automated dbt operati

889 Jan 01, 2023
Experiments with Tox plugin system

The project is an attempt to add to the tox some missing out of the box functionality. Basically it is just an extension for the tool that will be loa

Volodymyr Vitvitskyi 30 Nov 26, 2022
Junos PyEZ is a Python library to remotely manage/automate Junos devices.

The repo is under active development. If you take a clone, you are getting the latest, and perhaps not entirely stable code. DOCUMENTATION Official Do

Juniper Networks 623 Dec 10, 2022
Code and data for learning to search in local branching

Code and data for learning to search in local branching

Defeng Liu 7 Dec 06, 2022
🪄 Auto-generate Streamlit UI from Pydantic Models and Dataclasses.

Streamlit Pydantic Auto-generate Streamlit UI elements from Pydantic models. Getting Started • Documentation • Support • Report a Bug • Contribution •

Lukas Masuch 103 Dec 25, 2022
Advanced IPv4 Subnet Calculator in Python3

Advanced IPv4 Subnet Calculator in Python3 Table of Contents Getting Started Installation How it works? SVI Configuration Template Previews Getting St

Osama Abbas 1 May 10, 2022
Keyboard Layout Change - Extension for Ulauncher

Keyboard Layout Change - Extension for Ulauncher

Marco Borchi 4 Aug 26, 2022
This an Anki add on that automatically converts Notion notes into Anki flash cards. Currently in development!

NotionFlash This is an Anki add on in development that will allow automatically convert your Notion study notes into Anki flash cards. The Anki deck c

Neeraj Patel 10 Oct 07, 2022
My custom Fedora ostree build with sway/wayland.

Ramblurr's Sway Desktop This is an rpm-ostree based minimal Fedora developer desktop with the sway window manager and podman/toolbox for doing develop

Casey Link 1 Nov 28, 2021
Monitor the New World login queue and notify when it is about to finish

nwwatch - Monitor the New World queue and notify when it is about to finish Getting Started install python 3.7+ navigate to the directory where you un

14 Jan 10, 2022
Uma moeda simples e segura!

SecCoin - Documentação A SecCoin foi criada com intuito de ser uma moeda segura, de fácil investimento e mineração. A Criptomoeda está na sua primeira

Sec-Coin Team 5 Dec 09, 2022
Random pass word generator made with python. PyQt5 module is used to design GUI.

Differences in this GUI program : Default titlebar removed Custom Minimize,Maximize and Close Buttons Drag & move window from any point Program work l

Dimuth De Zoysa 1 Jan 26, 2022
An Embedded Linux Project Build and Compile Tool -- An Bitbake UI Extension

Dianshao - An Embedded Linux Project Build and Compile Tool

0 Mar 27, 2022
Calculadora-basica - Calculator with basic operators

Calculadora básica Calculadora com operadores básicos; O programa solicitará a d

Vitor Antoni 2 Apr 26, 2022
Force you (or your user) annotate Python function type hints.

Must-typing Force you (or your user) annotate function type hints. Notice: It's more like a joke, use it carefully. If you call must_typing in your mo

Konge 13 Feb 19, 2022
Introduction to Databases Coursework 2 (SQL) - dataset generator

Introduction to Databases Coursework 2 (SQL) - dataset generator This is python script generates a text file with insert queries for the schema.sql fi

Javier Bosch 1 Nov 08, 2021