# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
128523 |
2019-07-11T05:49:30 Z |
briansu |
City (JOI17_city) |
C++14 |
|
591 ms |
80720 KB |
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
#define REP(i, n) for(int i = 0;i < n;i ++)
#define REP1(i, n) for(int i = 1;i <= n;i ++)
#define FILL(i, n) memset(i, n, sizeof(i))
#define X first
#define Y second
#define pb push_back
#define SZ(_a) ((int)(_a).size())
#define ALL(_a) (_a).begin(), (_a).end()
#ifdef brian
#define IOS()
template<typename T>static void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...t>static void _do(T &&x, t &&...X){cerr<<x<<", ";_do(X...);}
#define debug(...) {\
fprintf(stderr, "%s - %d (%s) = ", __PRETTY_FUNCTION__, __LINE__, #__VA_ARGS__);\
_do(__VA_ARGS__);\
}
#else
#define debug(...)
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#endif
const ll MAXn = 3e5 + 5;
const ll INF = ll(1e17);
vector<ll> v[MAXn];
ll n, tit = 0, in[MAXn], out[MAXn];
void dfs(ll now,ll f)
{
in[now] = tit ++;
for(ll k:v[now])if(k != f)dfs(k, now);
out[now] = tit - 1;
}
void Encode(int N, int A[], int B[])
{
n = N;
REP(i, n - 1)v[A[i]].pb(B[i]), v[B[i]].pb(A[i]);
dfs(0, -1);
REP(i, n)Code(i, in[i] + (out[i] << 18));
}
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
#define REP(i, n) for(int i = 0;i < n;i ++)
#define REP1(i, n) for(int i = 1;i <= n;i ++)
#define FILL(i, n) memset(i, n, sizeof(i))
#define X first
#define Y second
#define pb push_back
#define SZ(_a) ((int)(_a).size())
#define ALL(_a) (_a).begin(), (_a).end()
#ifdef brian
#define IOS()
template<typename T>static void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...t>static void _do(T &&x, t &&...X){cerr<<x<<", ";_do(X...);}
#define debug(...) {\
fprintf(stderr, "%s - %d (%s) = ", __PRETTY_FUNCTION__, __LINE__, #__VA_ARGS__);\
_do(__VA_ARGS__);\
}
#else
#define debug(...)
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#endif
void InitDevice()
{
}
int Answer(long long S, long long T)
{
ll a = S & ((1 << 18) - 1), b = (S >> 18);
ll c = T & ((1 << 18) - 1), d = (T >> 18);
debug(a, b, c, d);
if(a < c && d <= b)return 1;
else if(c < a && b <= d)return 0;
else return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
14832 KB |
Output is correct |
2 |
Correct |
11 ms |
14832 KB |
Output is correct |
3 |
Correct |
10 ms |
14832 KB |
Output is correct |
4 |
Correct |
10 ms |
14832 KB |
Output is correct |
5 |
Correct |
10 ms |
14832 KB |
Output is correct |
6 |
Correct |
10 ms |
14832 KB |
Output is correct |
7 |
Correct |
10 ms |
14832 KB |
Output is correct |
8 |
Correct |
12 ms |
14832 KB |
Output is correct |
9 |
Correct |
10 ms |
14832 KB |
Output is correct |
10 |
Correct |
10 ms |
14832 KB |
Output is correct |
11 |
Correct |
10 ms |
14832 KB |
Output is correct |
12 |
Correct |
10 ms |
14840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
200 ms |
28880 KB |
Output is correct - L = 183239355 |
2 |
Correct |
201 ms |
29024 KB |
Output is correct - L = 182977210 |
3 |
Correct |
200 ms |
28912 KB |
Output is correct - L = 183239355 |
4 |
Correct |
200 ms |
28800 KB |
Output is correct - L = 183239355 |
5 |
Partially correct |
548 ms |
77872 KB |
Output is partially correct - L = 65535987855 |
6 |
Partially correct |
540 ms |
77760 KB |
Output is partially correct - L = 65535987855 |
7 |
Partially correct |
542 ms |
78064 KB |
Output is partially correct - L = 65535987855 |
8 |
Partially correct |
556 ms |
80720 KB |
Output is partially correct - L = 65535987855 |
9 |
Partially correct |
492 ms |
79040 KB |
Output is partially correct - L = 65535987855 |
10 |
Partially correct |
466 ms |
79048 KB |
Output is partially correct - L = 65535987855 |
11 |
Partially correct |
519 ms |
79256 KB |
Output is partially correct - L = 65535987855 |
12 |
Partially correct |
480 ms |
79088 KB |
Output is partially correct - L = 65535987855 |
13 |
Partially correct |
507 ms |
78552 KB |
Output is partially correct - L = 65535987855 |
14 |
Partially correct |
528 ms |
77904 KB |
Output is partially correct - L = 65535987855 |
15 |
Correct |
200 ms |
29008 KB |
Output is correct - L = 183239355 |
16 |
Correct |
201 ms |
28912 KB |
Output is correct - L = 183239355 |
17 |
Correct |
199 ms |
28912 KB |
Output is correct - L = 183239355 |
18 |
Partially correct |
513 ms |
77016 KB |
Output is partially correct - L = 65535987855 |
19 |
Partially correct |
515 ms |
76704 KB |
Output is partially correct - L = 65535987855 |
20 |
Partially correct |
520 ms |
76760 KB |
Output is partially correct - L = 65535987855 |
21 |
Partially correct |
530 ms |
77872 KB |
Output is partially correct - L = 65535987855 |
22 |
Partially correct |
515 ms |
76496 KB |
Output is partially correct - L = 65535987855 |
23 |
Partially correct |
541 ms |
76376 KB |
Output is partially correct - L = 65535987855 |
24 |
Partially correct |
544 ms |
76128 KB |
Output is partially correct - L = 65535987855 |
25 |
Partially correct |
557 ms |
75912 KB |
Output is partially correct - L = 65535987855 |
26 |
Partially correct |
591 ms |
75936 KB |
Output is partially correct - L = 65535987855 |
27 |
Partially correct |
577 ms |
75840 KB |
Output is partially correct - L = 65535987855 |