QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#520640#2358. What? Subtasks? Again?solar_expressWA 0ms3976kbC++14727b2024-08-15 14:29:042024-08-15 14:29:05

Judging History

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

  • [2024-08-15 14:29:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3976kb
  • [2024-08-15 14:29:04]
  • 提交

answer

#include <bits/stdc++.h>
#include <cstdio>

using namespace std;

map<int, set<int>> tasks;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    for (string line; getline(cin, line); ) {
        auto ifs = istringstream(line);
        string v;
        ifs >> v;
        int id;
        sscanf(v.c_str(), "CS-%d:", &id);
        for (; ifs >> v;) {
            int to;
            sscanf(v.c_str(), "CS-%d", &to);
            tasks[to].insert(id);
        }
    }
    for (auto& [k, S] : tasks) {
        cout << "CS-" << k << ":";
        for (auto it = begin(S); it != end(S); ++it) {
            cout << " CS-" << *it << ",\n"[next(it) == end(S)];
        }
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3976kb

input:

10 7 10
2 1
3 5
2 1
4 1
9 5
5 4
6 4
7 4
8 4
10 4

output:

CS-3: CS-0
CS-4: CS-0
CS-7: CS-0

result:

wrong answer 1st lines differ - expected: '6', found: 'CS-3: CS-0'