# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
427869 |
2021-06-15T02:55:59 Z |
errorgorn |
City (JOI17_city) |
C++17 |
|
564 ms |
41772 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];
ll in[250000];
ll 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 |
6400 KB |
Output is correct |
2 |
Correct |
5 ms |
6400 KB |
Output is correct |
3 |
Correct |
6 ms |
6336 KB |
Output is correct |
4 |
Correct |
5 ms |
6512 KB |
Output is correct |
5 |
Correct |
6 ms |
6400 KB |
Output is correct |
6 |
Correct |
4 ms |
6400 KB |
Output is correct |
7 |
Correct |
4 ms |
6484 KB |
Output is correct |
8 |
Correct |
5 ms |
6400 KB |
Output is correct |
9 |
Correct |
5 ms |
6400 KB |
Output is correct |
10 |
Correct |
4 ms |
6400 KB |
Output is correct |
11 |
Correct |
5 ms |
6400 KB |
Output is correct |
12 |
Correct |
4 ms |
6504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
198 ms |
15068 KB |
Output is correct - L = 174500698 |
2 |
Correct |
195 ms |
14968 KB |
Output is correct - L = 173000692 |
3 |
Correct |
192 ms |
15080 KB |
Output is correct - L = 173750696 |
4 |
Correct |
201 ms |
15048 KB |
Output is correct - L = 172750691 |
5 |
Partially correct |
512 ms |
40924 KB |
Output is partially correct - L = 62498499994 |
6 |
Partially correct |
521 ms |
41088 KB |
Output is partially correct - L = 62499749998 |
7 |
Partially correct |
564 ms |
41036 KB |
Output is partially correct - L = 62499249997 |
8 |
Partially correct |
529 ms |
40656 KB |
Output is partially correct - L = 62495749982 |
9 |
Partially correct |
456 ms |
41656 KB |
Output is partially correct - L = 62499499997 |
10 |
Partially correct |
445 ms |
41724 KB |
Output is partially correct - L = 62499249996 |
11 |
Partially correct |
458 ms |
41772 KB |
Output is partially correct - L = 62499749998 |
12 |
Partially correct |
439 ms |
41676 KB |
Output is partially correct - L = 62499249996 |
13 |
Partially correct |
471 ms |
41480 KB |
Output is partially correct - L = 62499499997 |
14 |
Partially correct |
550 ms |
41144 KB |
Output is partially correct - L = 62498499995 |
15 |
Correct |
194 ms |
14944 KB |
Output is correct - L = 173500695 |
16 |
Correct |
210 ms |
15068 KB |
Output is correct - L = 174500698 |
17 |
Correct |
203 ms |
15088 KB |
Output is correct - L = 174000697 |
18 |
Partially correct |
493 ms |
41348 KB |
Output is partially correct - L = 62499749998 |
19 |
Partially correct |
502 ms |
41424 KB |
Output is partially correct - L = 62495499982 |
20 |
Partially correct |
494 ms |
41140 KB |
Output is partially correct - L = 62495499982 |
21 |
Partially correct |
505 ms |
41384 KB |
Output is partially correct - L = 62499249998 |
22 |
Partially correct |
544 ms |
41224 KB |
Output is partially correct - L = 62495499983 |
23 |
Partially correct |
547 ms |
41156 KB |
Output is partially correct - L = 62495499983 |
24 |
Partially correct |
518 ms |
41108 KB |
Output is partially correct - L = 62495499984 |
25 |
Partially correct |
534 ms |
41036 KB |
Output is partially correct - L = 62495499985 |
26 |
Partially correct |
537 ms |
40928 KB |
Output is partially correct - L = 62495499986 |
27 |
Partially correct |
539 ms |
40936 KB |
Output is partially correct - L = 62495499988 |