Git Product home page Git Product logo

Comments (3)

maspypy avatar maspypy commented on September 10, 2024 1

ありがとうございます、作業までしていただけるならば、もちろんそうしていただけた方がありがたいです。

from library-checker-problems.

hitonanode avatar hitonanode commented on September 10, 2024

hitonanode/cplib-cpp#331 ですが、モノイドに作用がはたらく際、モノイドのもともとの最小値が作用の chmin の値に一致している場合の処理がバグっています。

今回のバグだと、例えば Range Chmin Chmax Add Range Sum - Library Checker私の提出

5 2
0 0 3 1 0
0 1 4 1
3 0 4

で落ちます(想定は 2、私の提出は 1)。

逆バージョンとして、モノイドのもともとの最大値が作用の chmax に一致している場合にバグっているコードは

5 2
0 0 1 0 1
1 1 5 1
3 0 5

で落とせます。

等号の場合の処理がバグの原因なので、 $A$ の値域が狭いケースがあると容易に落とせそうです。例えば以下の要領でランダムケースを作ると普通に落とせていそうです。

import random

random.seed(0)

N = 1000
Q = 1000

MINA = -3
MAXA = 3

A = [random.randint(MINA, MAXA) for _ in range(N)]

print(N, Q)
print(*A, sep=' ')

for _ in range(Q):
    tp = random.randint(0, 3)
    l, r = 0, 0

    while l >= r:
        l = random.randint(0, N)
        r = random.randint(0, N)

    if tp <= 2:
        b = random.randint(MINA, MAXA)
        print(tp, l, r, b)
    else:
        print(tp, l, r)

from library-checker-problems.

hitonanode avatar hitonanode commented on September 10, 2024

とりあえず上記の方針でテストケース追加 PR 出しましょうか? (どなたがやる形でもよいです)

from library-checker-problems.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.