1 solutions

  • 0
    @ 2023-10-29 17:12:26
    #!/usr/bin/env python
    
    from cyaron import * # 引入CYaRon的库
    import math
    
    _n = ati([0, 1E3, 1E5, 1E6, 32767]) # ati函数将数组中的每一个元素转换为整形,方便您可以使用1E4一类的数来表示数据大小
    _m = ati([0, 1E4, 1E6, 1E9, 1E6])
    _k = ati([0, 0, 10, 1000, 1E4])
    _t = ati([0, 4, 4, 2, 3])
    sn = 1
    
    for i in range(1, 4):
        for t in range(_t[i]):
            test_data = IO(file_prefix="test", data_id=sn)
            N = _n[i]
            M = _m[i]
            n = randint(1, N)
            q = randint(1, N)
            m = randint(n, M)
            test_data.input_writeln(n, q)
            a = Vector.random(n, [(1, m)], 0)
            test_data.input_writeln(a)
            b = Vector.random(q, [(1, m)], 0)
            test_data.input_writeln(b)
            test_data.output_gen("Main.exe") # 标程编译后的可执行文件,不需要freopen等,CYaRon自动给该程序输入并获得输出作为.out
            sn += 1
    #A2024
    
    
    
    
    • 1

    Information

    ID
    605
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    (None)
    # Submissions
    42
    Accepted
    8
    Uploaded By