QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#113161#1949. Simple Cron Specrgnerdplayer#WA 1ms3504kbC++201.8kb2023-06-16 16:07:232023-06-16 16:07:26

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-16 16:07:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3504kb
  • [2023-06-16 16:07:23]
  • 提交

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'