50分求助
查看原帖
50分求助
766148
yzx_yzx楼主2023/10/14 19:28
//yzx___2023.10.14
#include <bits/stdc++.h>
using namespace std;
int n, a[111111], b[111111], c[1111111], l = 1, d[1111111], t, ans;

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i] >> b[i];
		c[i] = 100 / a[i];
		ans += 100 / a[i] * b[i];
		d[i] = a[i] - b[i];
	}
	cin >> t;
	if (ans >= t) {
		cout << "Already Au.";
	} else {
		for (int i = 1; i <= n; i++) {
			int m = t - ans;
			l = 1;
			if (a[i] == b[i]) {
				cout << "NaN" << endl;
			} else {
				//for (int j = 1; m > 0; j++) {
				while (1) {
					m -= c[i];
					if ( m <= 0) {
						cout << l << endl;
						break;
					}
					l++;

					//}
				}
			}

		}
	}
	//cout << t << ' ' << ans;
	return 0;
}
2023/10/14 19:28
加载中...