1 条题解

  • 1
    @ 2026-4-5 9:36:39

    #include using namespace std;

    int main() { int n, x, y; cin >> n >> x >> y;

    // 向上取整公式:(y + x - 1) / x
    int eat = (y + x - 1) / x;
    
    // 剩余苹果不能小于0
    int left = n - eat;
    if (left < 0) left = 0;
    
    cout << left << endl;
    return 0;
    

    }

    • 1

    信息

    ID
    2720
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    2
    已通过
    2
    上传者