Skip to main content

Mục lục

1. Tổ chức & Mô tả

2. Ví dụ sử dụng



Nội dung

1. Tổ chức & Mô tả

itptit
|
|___common
|   |___math
|   |   |___...
|   |
|   |___random
|   |   |___Random
|   |   |___...
|   |
|   |___exceptions
|       |___...
|
|___generator
|   |___TestCaseFamily
|   |___Inerator
|   |___Outerator
|
|___judge
    |___SingleJudge
    |___MultiJudge
    |___...

Mô tả

Nội dung các class và function sẽ được mô tả bởi python docstring.

2. Ví dụ sử dụng

2.1. Problem

Tính tổng các số có trong dãy n phần tử với 2 ≤ n ≤ 3.

Input Output
1 2 3
1 2 3 6

2.1. Files

  • real_solution.py

ans = 0
for i in input().split():
    ans += int(i)
print(ans)
  • submitted_solution.cpp

#include <iostream>
using namespace std;

int main(){
    int x, y;
    cin >> x >> y;
    cout << x + y;
    return 0;
}
  • gen_test_case.py

from itptit.common.math import *
from itptit.common.random import *
from itptit.generator import TestCaseFamily, Inerator, Outerator
from itptit.judge import SingleJudge

def _2_numbers(x, y):
    print(x, y)

def _3_numbers(x, y, z):
    print(x, y, z)


# Create TestCaseFamily

tcf1 = TestCaseFamily(
    gen_func=_2_numbers,
    number_of_test_cases=2,
    args_list=[
        [1, 2],
        [2, 3]
    ]
)

tcf2 = TestCaseFamily(
    gen_func=_3_numbers,
    number_of_test_cases=3,
    args_list=[
        [1, 2, 3],
        [2, 3, 4],
        [3, 4, 5]
    ],
    name='3 numbers'                # Optional argument
)

# Generate input

ig = Inerator(
    'test/input',
    tcf1,
    tcf2,
    file_extension='itqh'           # Optional argument
)

ig.start()

# Generate output

og = Outerator(
    'test/input',
    'real_solution.py',
    'test/output',
    input_file_extension='itqh',    # Optional argument
    file_extension='otqh'           # Optional argument
)

og.start()

# Judgement

judge = SingleJudge(
    'test/input',
    'test/output',
    'submitted_solution.cpp', 
    time_limit=1,                   # Optional argument
    input_extension='itqh',         # Optional argument
    output_extension='otqh'         # Optional argument
)

judge.start()
  • Run "gen_test_case.py"

Start generating input for test cases:
- New: Created file "0.itqh" successfully in 0.00000s!
- New: Created file "1.itqh" successfully in 0.00000s!
- New: Created file "2.itqh" successfully in 0.00000s!
- New: Created file "3.itqh" successfully in 0.00000s!
- New: Created file "4.itqh" successfully in 0.00050s!
All test case's inputs have been generated.

Start generating output for test cases:
- New: Created file "0.otqh" successfully in 0.07481s!
- New: Created file "1.otqh" successfully in 0.10607s!
- New: Created file "2.otqh" successfully in 0.07828s!
- New: Created file "3.otqh" successfully in 0.06917s!
- New: Created file "4.otqh" successfully in 0.07155s!
All test case's outputs have been generated.

Start judgment:
- Testcase 0."0": Accepted (AC) in 0.063s.
- Testcase 1."1": Accepted (AC) in 0.082s.
- Testcase 2."2": Wrong answer (WA).
- Testcase 3."3": Wrong answer (WA).
- Testcase 4."4": Wrong answer (WA).
  > Result: Partial (2/5).

Metadata

Release files for itptit 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for itptit 1.0.2
File Interpreter ABI Platform Actions
itptit-1.0.2-py3-none-any.whl Python 3 none any Details for itptit-1.0.2-py3-none-any.whl

Release files / itptit-1.0.2-py3-none-any.whl

Download URL itptit-1.0.2-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3402eff5df9bb1e5250840716cdba69611ad9daef1823ac91d181e10bfc51d5
BLAKE2b-256 checksum
How to use checksums
a073905ce29d8bbb7bcdb52f3112702fb0d3d26a7a260b7a07a930688ff5a562
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Security for itptit 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page