Submission #1077972

# Submission time Handle Problem Language Result Execution time Memory
1077972 2024-08-27T11:19:41 Z TB_ Toy Train (IOI17_train) C++17
0 / 100
5 ms 1372 KB
#include <bits/stdc++.h>

using namespace std;
#define ll long long 
#define fo(i, n) for(ll i = 0; i<(n); i++)
#define F first 
#define S second 
#define pb push_back 
#define deb(x) cout << #x << " = " << (x) << endl
#define deb2(x, y) cout << #x << " = " << (x)  << ", " << #y << " = " << (y) << endl

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pl;
typedef vector<pl> vpl;

ll n;
vvl adj(6000);


std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) {
    n = a.size();
    ll m = u.size();

    vl selfEdge(n+1, 0);
    fo(i, m){
        if(u[i] == v[i]) selfEdge[u[i]] = 1;
        else{
            adj[u[i]].pb(v[i]);
        }
    }
    vector<int> res(n);
    ll last = 0;
    for(int i = n-1; i>=0;i--){
        if(selfEdge[i]){
            last = a[i]==r[i];
        }
        res[i] = last;
    }


	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 856 KB 3rd lines differ - on the 10th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 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 1372 KB Output is correct
2 Correct 4 ms 1372 KB Output is correct
3 Correct 4 ms 1372 KB Output is correct
4 Incorrect 5 ms 1344 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 1372 KB 3rd lines differ - on the 696th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1372 KB 3rd lines differ - on the 2nd token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 856 KB 3rd lines differ - on the 10th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -