记录编号 571816 评测结果 AAAAAAAAAA
题目名称 士兵放假了 最终得分 100
用户昵称 GravatarHeSn 是否通过 通过
代码语言 C++ 运行时间 0.000 s
提交时间 2022-06-25 11:33:47 内存使用 0.00 MiB
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int main() {
	freopen("holiday_and_angryF.in", "r", stdin);
	freopen("holiday_and_angryF.out", "w", stdout);
	int n;
	double m, k, jia = 0.0, jian = 0.0, cheng = 1.0, chu = 1.0;
	cin >> n >> m >> k;
	for(int i = 1; i <= n; i ++) {
		char op;
		double x;
		cin >> x >> op;
		if(op == '+') {
			jia += x;
		}
		if(op == '-') {
			jian += x;
		}
		if(op == '*') {
			cheng *= x;
		}
		if(op == '/') {
			chu *= x;
		}
	}
	k = k / chu;
	k = k + jia;
	k = k * cheng;
	k = k - jian;
	if(k > m) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	cout << (long long)k << endl;
	return 0;
}