1 条题解

  • 1
    @ 2023-4-10 12:45:01
    # include <bits/stdc++.h>
    using namespace std;
    int main() {
    	int m, n;
    	long long sum = 0, cnt = 0;
    	long long c, p1, p2, s1, s2;
    	cin >> n;
    	for (int i = 1; i <= n; i++) {
    		cin >> c;
    		sum += c;
    		cnt += c * i;
    	}
    	cin >> m >> p1 >> s1 >> s2;
    	sum += s1;
    	cnt += p1 * s1;
    	sum += s2;
    	cnt -= sum * m;
    	p2 = -(cnt - s2 / 2) / s2;
    	if (p2 < 1) {
    		p2 = 1;
    	} else if (p2 > n) {
    		p2 = n;
    	}
    	cout << p2;
    	return 0;
    }
    
    • 1

    信息

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