#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int,int>pii;
#define SIZE (1<<21)
#define LOG 21
class unionfind
{
public:
int par[SIZE * 2];
int ran[SIZE * 2];
void init()
{
for (int i = 0; i<SIZE * 2; i++)
{
par[i] = i;
ran[i] = 0;
}
}
int find(int a)
{
if (a == par[a])return a;
else return par[a] = find(par[a]);
}
void unite(int a, int b)
{
//printf("%d %d\n", a, b);
a = find(a);
b = find(b);
if (a == b)return;
if (ran[a]>ran[b])
{
par[b] = a;
}
else
{
par[a] = b;
}
if (ran[a] == ran[b])ran[b]++;
}
};
unionfind uf;
void adde(int a, int b, bool f)
{
if (f)uf.unite(a * 2, b * 2), uf.unite(a * 2 + 1, b * 2 + 1);
else uf.unite(a * 2, b * 2 + 1), uf.unite(a * 2 + 1, b * 2);
}
class segtree
{
public:
vector<pii>seg[1 << (LOG + 1)];
bool isok;
void init()
{
isok = true;
for (int i = 0; i < 1 << (LOG + 1); i++)seg[i].clear();
}
void add(int beg, int end)
{
int node = 1;
int lb = 0, ub = (1 << LOG) - 1;
for (;;)
{
int m = (lb + ub) / 2;
if (end <= m)ub = m, node = node * 2;
else if (m + 1 <= beg)lb = m + 1, node = node * 2 + 1;
else
{
seg[node].push_back(make_pair(beg, end));
break;
}
}
}
void solve1(int node, int lb, int ub)
{
sort(seg[node].begin(), seg[node].end());
vector<pii>a, b;
int mini = 1000000000;
for (int i = 0; i < seg[node].size(); i++)
{
if (mini > seg[node][i].second)
{
mini = seg[node][i].second;
a.push_back(seg[node][i]);
}
else b.push_back(seg[node][i]);
}
for (int i = 1; i < b.size(); i++)if (b[i - 1].second < b[i].second)isok = false;
int pt = 0;
for (int i = 0; i < a.size(); i++)
{
for (;;)
{
if (pt == b.size())break;
if (a[i].second > b[pt].second)break;
if (a[i].first < b[pt].first)adde(a[i].first, b[pt].first, false);
pt++;
}
if (pt != 0)pt--;
}
}
int idx[SIZE], imos[SIZE];
void solve2(int node, int lb, int ub)
{
fill(idx, idx + ub - lb + 1, -1);
fill(imos, imos + seg[node].size() + 1, 0);
for (int i = 0; i < seg[node].size(); i++)idx[seg[node][i].first - lb] = i;
for (int i = 1; i < ub - lb + 1; i++)if (idx[i] == -1)idx[i] = idx[i - 1];
for (int i = 0; i < seg[node * 2].size(); i++)if (idx[seg[node * 2][i].first - lb] < idx[seg[node * 2][i].second - lb])imos[idx[seg[node * 2][i].first - lb] + 1]++, imos[idx[seg[node * 2][i].second - lb]]--;
for (int i = 0; i < seg[node * 2].size(); i++)if (idx[seg[node * 2][i].first - lb] < idx[seg[node * 2][i].second - lb])adde(seg[node * 2][i].first, seg[node][idx[seg[node * 2][i].second - lb]].first, false);
for (int i = 1; i <= seg[node].size(); i++)imos[i] += imos[i - 1];
for (int i = 0; i<int(seg[node].size()) - 1; i++)if (imos[i])adde(seg[node][i].first, seg[node][i + 1].first, true);
}
void solve3(int node, int lb, int ub)
{
for (int i = 0; i < seg[node].size(); i++)swap(seg[node][i].first, seg[node][i].second);
sort(seg[node].begin(), seg[node].end());
for (int i = 0; i < seg[node].size(); i++)swap(seg[node][i].first, seg[node][i].second);
fill(idx, idx + ub - lb + 1, -1);
fill(imos, imos + seg[node].size() + 1, 0);
for (int i = 0; i < seg[node].size(); i++)idx[seg[node][i].second - lb] = i;
for (int i = 1; i < ub - lb + 1; i++)if (idx[i] == -1)idx[i] = idx[i - 1];
for (int i = 0; i < seg[node * 2 + 1].size(); i++)if (idx[seg[node * 2 + 1][i].first - lb] < idx[seg[node * 2 + 1][i].second - lb])imos[idx[seg[node * 2 + 1][i].first - lb] + 1]++, imos[idx[seg[node * 2 + 1][i].second - lb]]--;
for (int i = 0; i < seg[node * 2 + 1].size(); i++)if (idx[seg[node * 2 + 1][i].first - lb] < idx[seg[node * 2 + 1][i].second - lb])adde(seg[node * 2 + 1][i].first, seg[node][idx[seg[node * 2 + 1][i].second - lb]].first, false);
for (int i = 1; i <= seg[node].size(); i++)imos[i] += imos[i - 1];
for (int i = 0; i<int(seg[node].size()) - 1; i++)if (imos[i])adde(seg[node][i].first, seg[node][i + 1].first, true);
}
void calc()
{
for (int i = LOG - 1; i >= 0; i--)
{
for (int j = 0; j < (1 << i); j++)
{
int node = (1 << i) + j;
solve1(node, j << (LOG - i), ((j + 1) << (LOG - i)) - 1);
solve2(node, j << (LOG - i), (j << (LOG - i)) + (1 << (LOG - 1 - i)) - 1);
solve3(node, (j << (LOG - i)) + (1 << (LOG - 1 - i)), ((j + 1) << (LOG - i)) - 1);
for (int k = 0; k < seg[node * 2].size(); k++)seg[node].push_back(seg[node * 2][k]);
for (int k = 0; k < seg[node * 2 + 1].size(); k++)seg[node].push_back(seg[node * 2 + 1][k]);
}
}
}
};
segtree tree;
int main()
{
int num;
scanf("%d",&num);
tree.init();
vector<pii>vec;
for(int i=0;i<num;i++)
{
int za,zb;
scanf("%d%d",&za,&zb);
za--,zb--;
vec.push_back(make_pair(za,zb));
tree.add(za, zb);
}
uf.init();
tree.calc();
for (int i = 0; i < num; i++)if (uf.find(vec[i].first * 2) == uf.find(vec[i].first * 2 + 1))tree.isok = false;
int cnt = 0;
for (int i = 0; i < num; i++)if (uf.find(vec[i].first * 2) == vec[i].first * 2)cnt++;
for (int i = 0; i < num; i++)if (uf.find(vec[i].first * 2 + 1) == vec[i].first * 2 + 1)cnt++;
int ans=tree.isok;
for (int i = 0; i < cnt / 2; i++)ans = ans * 2 % 1000000007;
printf("%d\n",ans);
}
Compilation message
port_facility.cpp: In member function 'void segtree::solve1(int, int, int)':
port_facility.cpp:80:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node].size(); i++)
^
port_facility.cpp:89:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 1; i < b.size(); i++)if (b[i - 1].second < b[i].second)isok = false;
^
port_facility.cpp:91:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < a.size(); i++)
^
port_facility.cpp:95:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (pt == b.size())break;
^
port_facility.cpp: In member function 'void segtree::solve2(int, int, int)':
port_facility.cpp:108:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node].size(); i++)idx[seg[node][i].first - lb] = i;
^
port_facility.cpp:110:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node * 2].size(); i++)if (idx[seg[node * 2][i].first - lb] < idx[seg[node * 2][i].second - lb])imos[idx[seg[node * 2][i].first - lb] + 1]++, imos[idx[seg[node * 2][i].second - lb]]--;
^
port_facility.cpp:111:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node * 2].size(); i++)if (idx[seg[node * 2][i].first - lb] < idx[seg[node * 2][i].second - lb])adde(seg[node * 2][i].first, seg[node][idx[seg[node * 2][i].second - lb]].first, false);
^
port_facility.cpp:112:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 1; i <= seg[node].size(); i++)imos[i] += imos[i - 1];
^
port_facility.cpp: In member function 'void segtree::solve3(int, int, int)':
port_facility.cpp:117:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node].size(); i++)swap(seg[node][i].first, seg[node][i].second);
^
port_facility.cpp:119:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node].size(); i++)swap(seg[node][i].first, seg[node][i].second);
^
port_facility.cpp:122:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node].size(); i++)idx[seg[node][i].second - lb] = i;
^
port_facility.cpp:124:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node * 2 + 1].size(); i++)if (idx[seg[node * 2 + 1][i].first - lb] < idx[seg[node * 2 + 1][i].second - lb])imos[idx[seg[node * 2 + 1][i].first - lb] + 1]++, imos[idx[seg[node * 2 + 1][i].second - lb]]--;
^
port_facility.cpp:125:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < seg[node * 2 + 1].size(); i++)if (idx[seg[node * 2 + 1][i].first - lb] < idx[seg[node * 2 + 1][i].second - lb])adde(seg[node * 2 + 1][i].first, seg[node][idx[seg[node * 2 + 1][i].second - lb]].first, false);
^
port_facility.cpp:126:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 1; i <= seg[node].size(); i++)imos[i] += imos[i - 1];
^
port_facility.cpp: In member function 'void segtree::calc()':
port_facility.cpp:139:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int k = 0; k < seg[node * 2].size(); k++)seg[node].push_back(seg[node * 2][k]);
^
port_facility.cpp:140:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int k = 0; k < seg[node * 2 + 1].size(); k++)seg[node].push_back(seg[node * 2 + 1][k]);
^
port_facility.cpp: In function 'int main()':
port_facility.cpp:149:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&num);
^
port_facility.cpp:155:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&za,&zb);
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
209 ms |
148640 KB |
Output is correct |
2 |
Correct |
176 ms |
148640 KB |
Output is correct |
3 |
Correct |
186 ms |
148640 KB |
Output is correct |
4 |
Correct |
203 ms |
148640 KB |
Output is correct |
5 |
Correct |
203 ms |
148640 KB |
Output is correct |
6 |
Correct |
186 ms |
148640 KB |
Output is correct |
7 |
Correct |
196 ms |
148640 KB |
Output is correct |
8 |
Correct |
189 ms |
148640 KB |
Output is correct |
9 |
Correct |
199 ms |
148640 KB |
Output is correct |
10 |
Correct |
196 ms |
148640 KB |
Output is correct |
11 |
Correct |
206 ms |
148640 KB |
Output is correct |
12 |
Correct |
196 ms |
148640 KB |
Output is correct |
13 |
Correct |
196 ms |
148640 KB |
Output is correct |
14 |
Correct |
193 ms |
148640 KB |
Output is correct |
15 |
Correct |
206 ms |
148640 KB |
Output is correct |
16 |
Correct |
203 ms |
148640 KB |
Output is correct |
17 |
Correct |
199 ms |
148640 KB |
Output is correct |
18 |
Correct |
196 ms |
148640 KB |
Output is correct |
19 |
Correct |
203 ms |
148640 KB |
Output is correct |
20 |
Correct |
199 ms |
148640 KB |
Output is correct |
21 |
Correct |
196 ms |
148640 KB |
Output is correct |
22 |
Correct |
193 ms |
148640 KB |
Output is correct |
23 |
Correct |
186 ms |
148640 KB |
Output is correct |
24 |
Correct |
186 ms |
148640 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
209 ms |
148640 KB |
Output is correct |
2 |
Correct |
176 ms |
148640 KB |
Output is correct |
3 |
Correct |
186 ms |
148640 KB |
Output is correct |
4 |
Correct |
203 ms |
148640 KB |
Output is correct |
5 |
Correct |
203 ms |
148640 KB |
Output is correct |
6 |
Correct |
186 ms |
148640 KB |
Output is correct |
7 |
Correct |
196 ms |
148640 KB |
Output is correct |
8 |
Correct |
189 ms |
148640 KB |
Output is correct |
9 |
Correct |
199 ms |
148640 KB |
Output is correct |
10 |
Correct |
196 ms |
148640 KB |
Output is correct |
11 |
Correct |
206 ms |
148640 KB |
Output is correct |
12 |
Correct |
196 ms |
148640 KB |
Output is correct |
13 |
Correct |
196 ms |
148640 KB |
Output is correct |
14 |
Correct |
193 ms |
148640 KB |
Output is correct |
15 |
Correct |
206 ms |
148640 KB |
Output is correct |
16 |
Correct |
203 ms |
148640 KB |
Output is correct |
17 |
Correct |
199 ms |
148640 KB |
Output is correct |
18 |
Correct |
196 ms |
148640 KB |
Output is correct |
19 |
Correct |
203 ms |
148640 KB |
Output is correct |
20 |
Correct |
199 ms |
148640 KB |
Output is correct |
21 |
Correct |
196 ms |
148640 KB |
Output is correct |
22 |
Correct |
193 ms |
148640 KB |
Output is correct |
23 |
Correct |
186 ms |
148640 KB |
Output is correct |
24 |
Correct |
186 ms |
148640 KB |
Output is correct |
25 |
Correct |
196 ms |
148912 KB |
Output is correct |
26 |
Correct |
189 ms |
148916 KB |
Output is correct |
27 |
Correct |
196 ms |
149036 KB |
Output is correct |
28 |
Correct |
196 ms |
148904 KB |
Output is correct |
29 |
Correct |
209 ms |
148924 KB |
Output is correct |
30 |
Correct |
186 ms |
148904 KB |
Output is correct |
31 |
Correct |
193 ms |
148908 KB |
Output is correct |
32 |
Correct |
193 ms |
148916 KB |
Output is correct |
33 |
Correct |
206 ms |
148904 KB |
Output is correct |
34 |
Correct |
196 ms |
148904 KB |
Output is correct |
35 |
Correct |
216 ms |
149048 KB |
Output is correct |
36 |
Correct |
189 ms |
148896 KB |
Output is correct |
37 |
Correct |
203 ms |
148896 KB |
Output is correct |
38 |
Correct |
199 ms |
148900 KB |
Output is correct |
39 |
Correct |
203 ms |
149048 KB |
Output is correct |
40 |
Correct |
206 ms |
149048 KB |
Output is correct |
41 |
Correct |
186 ms |
148912 KB |
Output is correct |
42 |
Correct |
196 ms |
148912 KB |
Output is correct |
43 |
Correct |
189 ms |
149048 KB |
Output is correct |
44 |
Correct |
203 ms |
149048 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
209 ms |
148640 KB |
Output is correct |
2 |
Correct |
176 ms |
148640 KB |
Output is correct |
3 |
Correct |
186 ms |
148640 KB |
Output is correct |
4 |
Correct |
203 ms |
148640 KB |
Output is correct |
5 |
Correct |
203 ms |
148640 KB |
Output is correct |
6 |
Correct |
186 ms |
148640 KB |
Output is correct |
7 |
Correct |
196 ms |
148640 KB |
Output is correct |
8 |
Correct |
189 ms |
148640 KB |
Output is correct |
9 |
Correct |
199 ms |
148640 KB |
Output is correct |
10 |
Correct |
196 ms |
148640 KB |
Output is correct |
11 |
Correct |
206 ms |
148640 KB |
Output is correct |
12 |
Correct |
196 ms |
148640 KB |
Output is correct |
13 |
Correct |
196 ms |
148640 KB |
Output is correct |
14 |
Correct |
193 ms |
148640 KB |
Output is correct |
15 |
Correct |
206 ms |
148640 KB |
Output is correct |
16 |
Correct |
203 ms |
148640 KB |
Output is correct |
17 |
Correct |
199 ms |
148640 KB |
Output is correct |
18 |
Correct |
196 ms |
148640 KB |
Output is correct |
19 |
Correct |
203 ms |
148640 KB |
Output is correct |
20 |
Correct |
199 ms |
148640 KB |
Output is correct |
21 |
Correct |
196 ms |
148640 KB |
Output is correct |
22 |
Correct |
193 ms |
148640 KB |
Output is correct |
23 |
Correct |
186 ms |
148640 KB |
Output is correct |
24 |
Correct |
186 ms |
148640 KB |
Output is correct |
25 |
Correct |
196 ms |
148912 KB |
Output is correct |
26 |
Correct |
189 ms |
148916 KB |
Output is correct |
27 |
Correct |
196 ms |
149036 KB |
Output is correct |
28 |
Correct |
196 ms |
148904 KB |
Output is correct |
29 |
Correct |
209 ms |
148924 KB |
Output is correct |
30 |
Correct |
186 ms |
148904 KB |
Output is correct |
31 |
Correct |
193 ms |
148908 KB |
Output is correct |
32 |
Correct |
193 ms |
148916 KB |
Output is correct |
33 |
Correct |
206 ms |
148904 KB |
Output is correct |
34 |
Correct |
196 ms |
148904 KB |
Output is correct |
35 |
Correct |
216 ms |
149048 KB |
Output is correct |
36 |
Correct |
189 ms |
148896 KB |
Output is correct |
37 |
Correct |
203 ms |
148896 KB |
Output is correct |
38 |
Correct |
199 ms |
148900 KB |
Output is correct |
39 |
Correct |
203 ms |
149048 KB |
Output is correct |
40 |
Correct |
206 ms |
149048 KB |
Output is correct |
41 |
Correct |
186 ms |
148912 KB |
Output is correct |
42 |
Correct |
196 ms |
148912 KB |
Output is correct |
43 |
Correct |
189 ms |
149048 KB |
Output is correct |
44 |
Correct |
203 ms |
149048 KB |
Output is correct |
45 |
Correct |
279 ms |
164180 KB |
Output is correct |
46 |
Correct |
309 ms |
164216 KB |
Output is correct |
47 |
Correct |
276 ms |
164176 KB |
Output is correct |
48 |
Correct |
306 ms |
164168 KB |
Output is correct |
49 |
Correct |
296 ms |
164116 KB |
Output is correct |
50 |
Correct |
286 ms |
164192 KB |
Output is correct |
51 |
Correct |
293 ms |
164428 KB |
Output is correct |
52 |
Correct |
343 ms |
172376 KB |
Output is correct |
53 |
Correct |
246 ms |
155508 KB |
Output is correct |
54 |
Correct |
239 ms |
155188 KB |
Output is correct |
55 |
Correct |
243 ms |
156160 KB |
Output is correct |
56 |
Correct |
236 ms |
156164 KB |
Output is correct |
57 |
Correct |
323 ms |
169252 KB |
Output is correct |
58 |
Correct |
306 ms |
169252 KB |
Output is correct |
59 |
Correct |
316 ms |
169224 KB |
Output is correct |
60 |
Correct |
313 ms |
167920 KB |
Output is correct |
61 |
Correct |
323 ms |
166968 KB |
Output is correct |
62 |
Correct |
323 ms |
169228 KB |
Output is correct |
63 |
Correct |
323 ms |
167892 KB |
Output is correct |
64 |
Correct |
299 ms |
166940 KB |
Output is correct |
65 |
Correct |
263 ms |
155900 KB |
Output is correct |
66 |
Correct |
263 ms |
156544 KB |
Output is correct |
67 |
Correct |
259 ms |
156088 KB |
Output is correct |
68 |
Correct |
246 ms |
156672 KB |
Output is correct |
69 |
Correct |
259 ms |
155424 KB |
Output is correct |
70 |
Correct |
243 ms |
155420 KB |
Output is correct |
71 |
Correct |
233 ms |
155200 KB |
Output is correct |
72 |
Correct |
246 ms |
155136 KB |
Output is correct |
73 |
Correct |
249 ms |
155188 KB |
Output is correct |
74 |
Correct |
263 ms |
155124 KB |
Output is correct |
75 |
Correct |
299 ms |
168024 KB |
Output is correct |
76 |
Correct |
293 ms |
170468 KB |
Output is correct |
77 |
Correct |
313 ms |
170472 KB |
Output is correct |
78 |
Correct |
293 ms |
164192 KB |
Output is correct |
79 |
Correct |
289 ms |
164184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
209 ms |
148640 KB |
Output is correct |
2 |
Correct |
176 ms |
148640 KB |
Output is correct |
3 |
Correct |
186 ms |
148640 KB |
Output is correct |
4 |
Correct |
203 ms |
148640 KB |
Output is correct |
5 |
Correct |
203 ms |
148640 KB |
Output is correct |
6 |
Correct |
186 ms |
148640 KB |
Output is correct |
7 |
Correct |
196 ms |
148640 KB |
Output is correct |
8 |
Correct |
189 ms |
148640 KB |
Output is correct |
9 |
Correct |
199 ms |
148640 KB |
Output is correct |
10 |
Correct |
196 ms |
148640 KB |
Output is correct |
11 |
Correct |
206 ms |
148640 KB |
Output is correct |
12 |
Correct |
196 ms |
148640 KB |
Output is correct |
13 |
Correct |
196 ms |
148640 KB |
Output is correct |
14 |
Correct |
193 ms |
148640 KB |
Output is correct |
15 |
Correct |
206 ms |
148640 KB |
Output is correct |
16 |
Correct |
203 ms |
148640 KB |
Output is correct |
17 |
Correct |
199 ms |
148640 KB |
Output is correct |
18 |
Correct |
196 ms |
148640 KB |
Output is correct |
19 |
Correct |
203 ms |
148640 KB |
Output is correct |
20 |
Correct |
199 ms |
148640 KB |
Output is correct |
21 |
Correct |
196 ms |
148640 KB |
Output is correct |
22 |
Correct |
193 ms |
148640 KB |
Output is correct |
23 |
Correct |
186 ms |
148640 KB |
Output is correct |
24 |
Correct |
186 ms |
148640 KB |
Output is correct |
25 |
Correct |
196 ms |
148912 KB |
Output is correct |
26 |
Correct |
189 ms |
148916 KB |
Output is correct |
27 |
Correct |
196 ms |
149036 KB |
Output is correct |
28 |
Correct |
196 ms |
148904 KB |
Output is correct |
29 |
Correct |
209 ms |
148924 KB |
Output is correct |
30 |
Correct |
186 ms |
148904 KB |
Output is correct |
31 |
Correct |
193 ms |
148908 KB |
Output is correct |
32 |
Correct |
193 ms |
148916 KB |
Output is correct |
33 |
Correct |
206 ms |
148904 KB |
Output is correct |
34 |
Correct |
196 ms |
148904 KB |
Output is correct |
35 |
Correct |
216 ms |
149048 KB |
Output is correct |
36 |
Correct |
189 ms |
148896 KB |
Output is correct |
37 |
Correct |
203 ms |
148896 KB |
Output is correct |
38 |
Correct |
199 ms |
148900 KB |
Output is correct |
39 |
Correct |
203 ms |
149048 KB |
Output is correct |
40 |
Correct |
206 ms |
149048 KB |
Output is correct |
41 |
Correct |
186 ms |
148912 KB |
Output is correct |
42 |
Correct |
196 ms |
148912 KB |
Output is correct |
43 |
Correct |
189 ms |
149048 KB |
Output is correct |
44 |
Correct |
203 ms |
149048 KB |
Output is correct |
45 |
Correct |
279 ms |
164180 KB |
Output is correct |
46 |
Correct |
309 ms |
164216 KB |
Output is correct |
47 |
Correct |
276 ms |
164176 KB |
Output is correct |
48 |
Correct |
306 ms |
164168 KB |
Output is correct |
49 |
Correct |
296 ms |
164116 KB |
Output is correct |
50 |
Correct |
286 ms |
164192 KB |
Output is correct |
51 |
Correct |
293 ms |
164428 KB |
Output is correct |
52 |
Correct |
343 ms |
172376 KB |
Output is correct |
53 |
Correct |
246 ms |
155508 KB |
Output is correct |
54 |
Correct |
239 ms |
155188 KB |
Output is correct |
55 |
Correct |
243 ms |
156160 KB |
Output is correct |
56 |
Correct |
236 ms |
156164 KB |
Output is correct |
57 |
Correct |
323 ms |
169252 KB |
Output is correct |
58 |
Correct |
306 ms |
169252 KB |
Output is correct |
59 |
Correct |
316 ms |
169224 KB |
Output is correct |
60 |
Correct |
313 ms |
167920 KB |
Output is correct |
61 |
Correct |
323 ms |
166968 KB |
Output is correct |
62 |
Correct |
323 ms |
169228 KB |
Output is correct |
63 |
Correct |
323 ms |
167892 KB |
Output is correct |
64 |
Correct |
299 ms |
166940 KB |
Output is correct |
65 |
Correct |
263 ms |
155900 KB |
Output is correct |
66 |
Correct |
263 ms |
156544 KB |
Output is correct |
67 |
Correct |
259 ms |
156088 KB |
Output is correct |
68 |
Correct |
246 ms |
156672 KB |
Output is correct |
69 |
Correct |
259 ms |
155424 KB |
Output is correct |
70 |
Correct |
243 ms |
155420 KB |
Output is correct |
71 |
Correct |
233 ms |
155200 KB |
Output is correct |
72 |
Correct |
246 ms |
155136 KB |
Output is correct |
73 |
Correct |
249 ms |
155188 KB |
Output is correct |
74 |
Correct |
263 ms |
155124 KB |
Output is correct |
75 |
Correct |
299 ms |
168024 KB |
Output is correct |
76 |
Correct |
293 ms |
170468 KB |
Output is correct |
77 |
Correct |
313 ms |
170472 KB |
Output is correct |
78 |
Correct |
293 ms |
164192 KB |
Output is correct |
79 |
Correct |
289 ms |
164184 KB |
Output is correct |
80 |
Correct |
1413 ms |
282428 KB |
Output is correct |
81 |
Correct |
1396 ms |
282392 KB |
Output is correct |
82 |
Correct |
1383 ms |
282356 KB |
Output is correct |
83 |
Correct |
1383 ms |
282680 KB |
Output is correct |
84 |
Correct |
1326 ms |
282420 KB |
Output is correct |
85 |
Correct |
1416 ms |
278404 KB |
Output is correct |
86 |
Correct |
1389 ms |
282544 KB |
Output is correct |
87 |
Correct |
1949 ms |
370044 KB |
Output is correct |
88 |
Correct |
639 ms |
183992 KB |
Output is correct |
89 |
Correct |
696 ms |
182248 KB |
Output is correct |
90 |
Correct |
709 ms |
183232 KB |
Output is correct |
91 |
Correct |
723 ms |
183232 KB |
Output is correct |
92 |
Correct |
1679 ms |
338792 KB |
Output is correct |
93 |
Correct |
1616 ms |
338792 KB |
Output is correct |
94 |
Correct |
1579 ms |
337596 KB |
Output is correct |
95 |
Correct |
1556 ms |
320968 KB |
Output is correct |
96 |
Correct |
1436 ms |
311316 KB |
Output is correct |
97 |
Correct |
1579 ms |
335484 KB |
Output is correct |
98 |
Correct |
1503 ms |
320940 KB |
Output is correct |
99 |
Correct |
1466 ms |
314504 KB |
Output is correct |
100 |
Correct |
903 ms |
186436 KB |
Output is correct |
101 |
Correct |
903 ms |
185596 KB |
Output is correct |
102 |
Correct |
779 ms |
182520 KB |
Output is correct |
103 |
Correct |
803 ms |
181492 KB |
Output is correct |
104 |
Correct |
793 ms |
183396 KB |
Output is correct |
105 |
Correct |
756 ms |
182992 KB |
Output is correct |
106 |
Correct |
873 ms |
178148 KB |
Output is correct |
107 |
Correct |
783 ms |
178148 KB |
Output is correct |
108 |
Correct |
783 ms |
186344 KB |
Output is correct |
109 |
Correct |
759 ms |
186352 KB |
Output is correct |
110 |
Correct |
1626 ms |
326448 KB |
Output is correct |
111 |
Correct |
1986 ms |
350864 KB |
Output is correct |
112 |
Correct |
1973 ms |
350852 KB |
Output is correct |
113 |
Correct |
1293 ms |
282408 KB |
Output is correct |
114 |
Correct |
1343 ms |
282700 KB |
Output is correct |