第三届“传智杯”全国大学生IT技能大赛(初赛B组)
A - 课程报名
题意:
题解:
**代码: **
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n, v, m, a, cnt, res, floors;
int main() {
scanf("%d%d%d%d", &n, &v, &m, &a);
cnt = res = floors = 0;
while (cnt <= n) {
res += min(m, n - cnt) * (a * floors + v);
cnt += m;
floors++;
}
printf("%lld\n", res);
return 0;
}
B - 期末考试成绩
题意:
题解:
**代码: **
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
int const MAXN = 2e5 + 10;
int n, m, T;
double func(int x) {
if (x >= 90) return 4.0;
else if (x >= 60) return 4.0 - 0.1 * (90 - x);
}
int main() {
int n;
cin >> n;