Submission #832322

# Submission time Handle Problem Language Result Execution time Memory
832322 2023-08-21T08:57:29 Z finn__ Toy Train (IOI17_train) C++17
0 / 100
4 ms 852 KB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v)
{
    size_t const n = a.size(), m = u.size();
    int subtask = 1;
    for (size_t i = 0; i < m; ++i)
        if (u[i] != v[i] && u[i] + 1 != v[i])
        {
            subtask = 3;
            break;
        }

    vector<int> w(n);

    if (subtask == 1)
    {
        vector<bool> has_edge(n), has_loop(n);
        for (size_t i = 0; i < m; ++i)
        {
            if (u[i] == v[i])
                has_loop[u[i]] = 1;
            else
                has_edge[u[i]] = 1;
        }

        for (size_t i = 0; i < n; ++i)
        {
            for (size_t j = i; j < n; ++j)
                if (has_loop[j])
                {
                    if (!(a[j] ^ r[j]))
                    {
                        w[i] = a[j];
                        break;
                    }
                    if (!has_edge[i])
                    {
                        w[i] = !a[j];
                        break;
                    }
                }
        }
    }

    for (int &x : a)
        if (!x)
        {
            subtask = 4;
            break;
        }

    if (subtask == 3)
    {
    }
    else
    {
    }

    return w;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 468 KB Output is correct
2 Incorrect 2 ms 596 KB 3rd lines differ - on the 4997th token, expected: '1', found: '0'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 852 KB Output is correct
2 Correct 4 ms 852 KB Output is correct
3 Correct 4 ms 852 KB Output is correct
4 Incorrect 4 ms 832 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 724 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 852 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 468 KB Output is correct
2 Incorrect 2 ms 596 KB 3rd lines differ - on the 4997th token, expected: '1', found: '0'
3 Halted 0 ms 0 KB -