# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
551930 |
2022-04-21T22:39:29 Z |
Lobo |
City (JOI17_city) |
C++17 |
|
367 ms |
43448 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++) {
// cout << i << " " << 1000000*tin[i]+tout[i] << endl;
Code(i,250000*tin[i]+tout[i]);
}
}
// int32_t main() {
// ios::sync_with_stdio(false); cin.tie(0);
// freopen("in.in", "r", stdin);
// // freopen("out.out", "w", stdout);
// int32_t n; cin >> n;
// int32_t a[n-1],b[n-1];
// for(int i = 0; i < n-1; i++) {
// cin >> a[i] >> b[i];
// }
// Encode(n,a,b);
// }
#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/(250000);
int out1 = S-in1*250000;
int in2 = T/(250000);
int out2 = T-in2*250000;
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 |
Correct |
3 ms |
7716 KB |
Output is correct |
2 |
Correct |
4 ms |
7708 KB |
Output is correct |
3 |
Correct |
4 ms |
7716 KB |
Output is correct |
4 |
Correct |
4 ms |
7716 KB |
Output is correct |
5 |
Correct |
3 ms |
7716 KB |
Output is correct |
6 |
Correct |
4 ms |
7716 KB |
Output is correct |
7 |
Correct |
4 ms |
7716 KB |
Output is correct |
8 |
Correct |
3 ms |
7708 KB |
Output is correct |
9 |
Correct |
4 ms |
7716 KB |
Output is correct |
10 |
Correct |
3 ms |
7676 KB |
Output is correct |
11 |
Correct |
4 ms |
7716 KB |
Output is correct |
12 |
Correct |
4 ms |
7716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
16268 KB |
Output is correct - L = 175000700 |
2 |
Correct |
152 ms |
16220 KB |
Output is correct - L = 174750699 |
3 |
Correct |
152 ms |
16248 KB |
Output is correct - L = 175000700 |
4 |
Correct |
157 ms |
16224 KB |
Output is correct - L = 175000700 |
5 |
Incorrect |
367 ms |
43448 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |