QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#113161 | #1949. Simple Cron Spec | rgnerdplayer# | WA | 1ms | 3504kb | C++20 | 1.8kb | 2023-06-16 16:07:23 | 2023-06-16 16:07:26 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
auto solve = [&]() {
int n;
cin >> n;
vector a(n, vector(3, bitset<60>()));
for (int i = 0; i < n; i++) {
for (int j = 0; j < 3; j++) {
string s;
cin >> s;
if (s == "*") {
a[i][j].set();
} else {
s += "?";
for (int k = 0; k < int(s.size()); k += 3) {
int n1 = stoi(s.substr(k, 2));
if (s[k + 2] == '-') {
k += 3;
int n2 = stoi(s.substr(k, 2));
for (int t = n1; t <= n2; t++) {
a[i][j].set(t);
}
} else {
a[i][j].set(n1);
}
}
}
}
}
int ans1 = 0, ans2 = 0;
for (int h = 0; h < 24; h++) {
for (int m = 0; m < 60; m++) {
for (int s = 0; s < 60; s++) {
bool has = false;
for (int i = 0; i < n; i++) {
if (a[i][0][h] && a[i][1][m] && a[i][2][s]) {
has = true;
ans2++;
}
}
ans1 += has;
}
}
}
cout << ans1 << ' ' << ans2 << '\n';
};
solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3504kb
input:
3 * 5 15,30,45 6,12,18 30 0 8-17 0 30
output:
77 77
result:
wrong answer 1st lines differ - expected: '85 85', found: '77 77'