Submission #551925

# Submission time Handle Problem Language Result Execution time Memory
551925 2022-04-21T22:29:30 Z Lobo City (JOI17_city) C++17
0 / 100
175 ms 16220 KB
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;

const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
#define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()

const int maxn = 3e5+10;

int tin[maxn], tout[maxn], timer;
vector<int> g[maxn];

void dfs(int u, int ant) {
    tin[u] = ++timer;
    for(auto v : g[u]) if(v != ant) {
        dfs(v,u);
    }
    tout[u] = timer;
}

void Encode(int32_t N, int32_t A[], int32_t B[]) {
    for(int i = 0; i < N-1; i++) {
        g[A[i]].pb(B[i]);
        g[B[i]].pb(A[i]);
    }
    dfs(0,0);

    for(int i = 0; i < N; i++) {
        Code(i,tin[i]+1000000*tout[i]);
    }
}
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;

const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
#define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()

const int maxn = -1;

void InitDevice() {}

int32_t Answer(int S, int T) {
    int in1 = S/(1000000);
    int out1 = S-in1*1000000;
    int in2 = T/(1000000);
    int out2 = T-in2*1000000;
    
    if(in1 <= in2 && out1 >= out2) {
        return 1;
    }
    else if(in2 <= in1 && out2 >= out1) {
        return 0;
    }
    else {
        return 2;
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 7680 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 175 ms 16220 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -