Educational Codeforces Round 52 [Rated for Div. 2] 1065A 1065B 1065C

 A题良心秒切,没啥好说的

#include<iostream>
using namespace std;
int main() {
	long long t;
	while (cin >> t) {
		while (t--){
			long long s, a, b, c;
			cin >> s >> a >> b >> c;
			long long ans;
			ans = s / c + s / c / a*b;
			cout << ans << endl;
		}
	}
}

B题我真的佛了,自己菜的不行居然没想起来完全图……其实就是照这个性质去看(完全图消耗的边数最多的)

#include<iostream>
#include<algorithm>
using namespace std;

long long N, M;

int main() {
	cin >> N >> M;
	long long x = 0;
	while (M > x*(x - 1) / 2) {
		x++;
	}
	cout << max((long long)0, N - M * 2) << " " << N - x << endl;
	return 0;
}

C题贪心,但是题目实在没懂这期暂时不说了。。。。大家不要打我。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值