哈尔滨华德学院天梯赛选拔赛

A - 善良的xmy

直接输出就可以啦,签到题.

参考代码:

#include <bits/stdc++.h>

int main() {
    printf("xmy zui shan liang.");
    return 0;
}

B-wenju丢失身份证

注意格式化输入.

参考代码:

#include <bits/stdc++.h>

int main() {
    int h1, m1, s1, h2, m2, s2;
    scanf("%d:%d:%d - %d:%d:%d", &h1, &m1, &s1, &h2, &m2, &s2);
    int n, m;
    n = h1 * 3600 + m1 * 60 + s1;
    m = h2 * 3600 + m2 * 60 + s2;
    printf("%d\n", m - n);
    return 0;
}

C-温巨在装萌新

签到题.

参考代码:

#include <bits/stdc++.h>

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::string s;
    std::cin >> s;
    if (s.substr(0, 10) == "1134728508") {
        std::cout << "Yes\n";
    } else {
        std::cout << "No\n";
    }
    return 0;
}

D-白神遥的忧伤

直接计算即可,但是数据范围貌似除了问题,n 和 m要定义成long long类型,我因此WA了一发.

参考代码:

#include <bits/stdc++.h>
#define i64 long long
constexpr int N = 1e6 + 5;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int t; std::cin >> t;
    while (t--) {
        int x, y;
        std::cin >> x >> y;
        if (std::min(x, y) == 5 && std::max(x, y) == 8) {
            std::cout << "35\n";
        } else {
            std::cout << 1LL * x * y << "\n";
        }
    }
    return 0;
}

E-负债的东爱璃Lovely

签到题.

参考代码:

#include <bits/stdc++.h>
using i64 = long long;

template <typename T>
inline void read(T &f) {
    f = 0; T fu = 1; char c = getchar();
    while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar(); }
    while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
    f *= fu;
}

int main() {
    int n, m;
    read(n), read(m);
    std::vector<int> a(n);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        read(a[i]);
        cnt += a[i];
    }
    printf("%d\n", std::max(0, m - cnt * 12) * 2);
    //保证结果不为负数
    return 0;
}

F-清楚姐姐机器人化

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值