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;
}