1 solutions

  • 0
    @ 2022-9-3 11:30:34
    #!/usr/bin/env python
    
    from cyaron import * # 引入CYaRon的库
    import math
    
    _n = ati([0, 10, 1E3, 1E6, 32767]) # ati函数将数组中的每一个元素转换为整形,方便您可以使用1E4一类的数来表示数据大小
    _m = ati([0, 10, 100, 1000, 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]
            n = randint(2, n)
            b = randint(1, n)
            c = randint(1, n)
            test_data.input_writeln(n, b, c)
            s = []
            for j in range(n):
                name = String.random((10, 20), charset="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
                s.append(name)
            test_data.input_writeln(s)
            #print(s)
            d = Vector.random(b, [n-1])
            #print(d)
            d = sum(d,[])
            #print(d)
            sb = []
            for j in d:
                #print(s[j])
                sb.append(s[j])
            e = Vector.random(c, [n-1])
            e = sum(e,[])
            sc = []
            for j in e:
                pass
                sc.append(s[j])
            test_data.input_writeln(sb)
            test_data.input_writeln(sc)
            test_data.output_gen("SPY.exe") # 标程编译后的可执行文件,不需要freopen等,CYaRon自动给该程序输入并获得输出作为.out
            sn += 1
    
    • 1

    Information

    ID
    75
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    8
    Accepted
    1
    Uploaded By