Submission #920861

# Submission time Handle Problem Language Result Execution time Memory
920861 2024-02-03T06:41:17 Z gelastropod Monthly railway pass (LMIO18_menesinis_bilietas) C++14
0 / 100
311 ms 22352 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main()
{
    int N, M, a, b, ans = 0;
    cin >> N >> M;
    char t;
    bool is1 = true, is2 = true;
    vector<vector<int>> adjlist(N, vector<int>());
    for (int i = 0; i < M; i++)
    {
        cin >> a >> b >> t;
        a--, b--;
        adjlist[a].push_back(b);
        adjlist[b].push_back(a);
        if (t == 'A') is1 = false;
        if (t == 'T') is2 = false;
    }
    if (is2)
    {
        cout << N << '\n';
        return 0;
    }
    else if (is1)
    {
        for (int i = 0; i < N; i++)
        {
            if ((int)adjlist[i].size() == N - 1)
                ans++;
        }
        cout << ans << '\n';
        return 0;
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 311 ms 22352 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 11352 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -