Submission #500365

# Submission time Handle Problem Language Result Execution time Memory
500365 2021-12-30T19:34:04 Z Jaguar Monthly railway pass (LMIO18_menesinis_bilietas) C++14
0 / 100
3000 ms 5836 KB
#include <bits/stdc++.h>
using namespace std;
struct keliai{
    int prad;
    int tiksl;
    bool trauk;
};

int main()
{
    int n,m, kiekT=0, kiekA=0;
    cin >> n >> m;
    vector <int> ats;
    keliai kelias[m];
    bool visi[n]; fill(visi, visi+n, false);
    for (int i=0;i<m;i++){
        char temp;
        cin >> kelias[i].prad >> kelias[i].tiksl;cin >> temp;
        if(temp=='A'){kelias[i].trauk=false;kiekA++;}
        else {kelias[i].trauk=true;kiekT++;}
    }

    if(kiekA==m){
        for (int i=1; i<=n;i++){
            int temp=0;
            for (int j=0;j<m;j++){
                if(i==kelias[j].prad||i==kelias[j].tiksl){
                    temp++;
                }
            }
            if(temp==n-1) ats.push_back(i);
        }
    }

    cout << ats.size();
}
# Verdict Execution time Memory Grader output
1 Incorrect 280 ms 5836 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 716 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 11 ms 368 KB Output is correct
5 Correct 0 ms 296 KB Output is correct
6 Execution timed out 3078 ms 4172 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 11 ms 368 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -