# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
427868 |
2021-06-15T02:55:29 Z |
errorgorn |
City (JOI17_city) |
C++17 |
|
207 ms |
20328 KB |
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'
#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);s<e?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
int n;
vector<int> al[250000];
int in[250000];
int out[250000];
int TIME=0;
void dfs(int i,int p){
in[i]=TIME;
for (auto &it:al[i]){
if (it==p) continue;
dfs(it,i);
}
out[i]=TIME++;
Code(i,in[i]*250000+out[i]);
}
void Encode(int N, int A[], int B[]){
n=N;
rep(x,0,n-1){
al[A[x]].pub(B[x]);
al[B[x]].pub(A[x]);
}
dfs(0,-1);
}
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'
#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);s<e?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
void InitDevice()
{
}
int Answer(long long S, long long T){
ll sin=S/250000,sout=S%250000;
ll tin=T/250000,tout=T%250000;
if (sin<=tin && tout<=sout) return 1;
if (tin<=sin && sout<=tout) return 0;
return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
6372 KB |
Output is correct |
2 |
Correct |
4 ms |
6396 KB |
Output is correct |
3 |
Correct |
5 ms |
6396 KB |
Output is correct |
4 |
Correct |
5 ms |
6372 KB |
Output is correct |
5 |
Correct |
5 ms |
6392 KB |
Output is correct |
6 |
Correct |
4 ms |
6392 KB |
Output is correct |
7 |
Correct |
5 ms |
6396 KB |
Output is correct |
8 |
Correct |
4 ms |
6372 KB |
Output is correct |
9 |
Correct |
4 ms |
6400 KB |
Output is correct |
10 |
Correct |
5 ms |
6396 KB |
Output is correct |
11 |
Correct |
4 ms |
6372 KB |
Output is correct |
12 |
Correct |
5 ms |
6396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
207 ms |
15032 KB |
Output is correct - L = 174500698 |
2 |
Correct |
195 ms |
15140 KB |
Output is correct - L = 173000692 |
3 |
Correct |
204 ms |
14984 KB |
Output is correct - L = 173750696 |
4 |
Correct |
193 ms |
15000 KB |
Output is correct - L = 172750691 |
5 |
Incorrect |
200 ms |
20328 KB |
Wrong Answer [3] |
6 |
Halted |
0 ms |
0 KB |
- |