CSP-JT3为什么double就0pts,int就50pts?
  • 板块灌水区
  • 楼主KukCair
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/10/21 18:52
  • 上次更新2023/11/2 12:12:41
查看原帖
CSP-JT3为什么double就0pts,int就50pts?
767449
KukCair楼主2023/10/21 18:52

rt

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
double t, m, a, b, c;
int main(){
	cin >> t >> m;
	while(t--){
		cin >> a >> b >> c;
		if(b * b - 4 * a * c < 0){
			cout << "NO\n";
			continue;
		}
		else{
			double maxn = max((-b - sqrt(b * b - 4 * a * c)) / 2 / a, (-b + sqrt(b * b - 4 * a * c)) / 2 / a);
			cout << maxn << '\n';
		}
	}
	return 0;
}
2023/10/21 18:52
加载中...