AtCoder Beginner Contest 185
导读:
简单的题目,只说明题意,或者直接说明结论
下面的难题,会做详细的解释和证明
立个flag,在座的大佬们做个见证:一个月刷60场ABC,现在2021/7/3,第十八天,已打卡十五场。
A - ABC Preparation
输出最小值
void work()
{
int a, b, c, d; cin >> a >> b >> c >> d;
cout << min(min(a, b), min(c, d));
}
B - Smartphone Addiction
void work()
{
int n, m, t; cin >> n >> m >> t;
int now = n, last = 0;
while (m -- )
{
int a, b; cin >> a >> b;
now -= a - last;
if (now <= 0)
{
cout << "No" << endl;
return;
}
// printf("now = %d, a - last = %d\n", now, a - last);
now += b - a;
if (now > n) now = n;
// printf("now = %d, a - last = %d, b - a = %d\n", now, a - last, b - a);
last = b;
if (!m)
{
now -= t - b;
// printf("now = %d, t - b = %d\n", now, t - b);
if (now <= 0)
{
cout << "No" << endl;
return;
}
}
}
cout << "Yes" << endl;
return;
}
C - Duodecim Ferra
n长度,有n-1个数,选11个空插入板子,隔板法
void work()
{
long long n; cin >> n;
long long ans = 1;
for (long long i = 1; i <= 11; i ++ )
ans = ans * (n - i) / i;
cout << ans << endl;
}