7 条题解

  • 0
    @ 2025-6-5 14:43:16

    #include using namespace std; int main() { int a, b, c, y1, y2, y3; cin >> a >> b >> c; if(a >= 3 || b >= 5 || c >= 7 || a < 0 || b < 0 || c < 0) { cout << "no answer" << endl; return 0; } y1 = 2; y2 = 1; y3 = 1; const int m1 = 3, m2 = 5, m3 = 7; const int M = m1 * m2 * m3; int M1 = M / m1; int M2 = M / m2; int M3 = M / m3; int x = (a * M1 * y1 + b * M2 * y2 + c * M3 * y3) % M; if(x <= 10) { x += M; } if(x > 1000000) { cout << "no answer"; } else { cout << x; } return 0; }

    信息

    ID
    910
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    770
    已通过
    291
    上传者