#include <cstdio>
#ifdef DEBUG
#define D(X) X
#else
#define D(X)
#endif
#include <bits/stdc++.h>
#define fr first
#define sc second
#define ll long long
#define pi 3.14159265359
#define pub push_back
#define pob pop_back
#define pari pair<int,int>
#define parli pair<long, long>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const ll INF2 = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
bool comp(pari& v1, pari& v2)
{
return v1.fr < v2.fr;
}
struct seg {
vector<int> tree;
int sz;
void build(int n) {
sz = 1;
while(sz<n) {
sz *= 2;
}
tree.resize(2*sz + 1, 0);
}
void clean()
{
for(int i=0; i<tree.size(); i++) {
tree[i] = 0;
}
}
void recSet(int idx, int lx, int rx, int i, int val) {
if(rx-lx==1) {
tree[idx] = val;
return;
}
int mid = (lx+rx)/2;
if(i<mid) {
recSet(2*idx+1, lx, mid, i, val);
} else
{
recSet(2*idx+2, mid, rx, i, val);
}
tree[idx] = max(tree[2*idx+1], tree[2*idx+2]);
}
void setX(int i, int val) {
recSet(0, 0, sz, i, val);
}
int rec_range(int idx, int lx, int rx, int l, int r) {
if(lx>=l&&rx<=r) {
return tree[idx];
}
if(rx<=l||lx>=r) return 0;
int mid = (lx+rx)/2;
int left = rec_range(2*idx+1, lx, mid, l, r);
int right = rec_range(2*idx+2, mid, rx, l, r);
return max(left, right);
}
int range(int l, int r) {
if(l>=r) {
return 0;
}
return rec_range(0, 0, sz, l, r);
}
};
struct seg2 {
vector<int> tree;
int sz;
void build(int n) {
sz = 1;
while(sz<n) {
sz *= 2;
}
tree.resize(2*sz + 1, INF);
}
void clean()
{
for(int i=0; i<tree.size(); i++) {
tree[i] = INF;
}
}
void recSet(int idx, int lx, int rx, int i, int val) {
if(rx-lx==1) {
tree[idx] = val;
return;
}
int mid = (lx+rx)/2;
if(i<mid) {
recSet(2*idx+1, lx, mid, i, val);
} else
{
recSet(2*idx+2, mid, rx, i, val);
}
tree[idx] = min(tree[2*idx+1], tree[2*idx+2]);
}
void setX(int i, int val) {
recSet(0, 0, sz, i, val);
}
int rec_range(int idx, int lx, int rx, int l, int r) {
if(lx>=l&&rx<=r) {
return tree[idx];
}
if(rx<=l||lx>=r) return INF;
int mid = (lx+rx)/2;
int left = rec_range(2*idx+1, lx, mid, l, r);
int right = rec_range(2*idx+2, mid, rx, l, r);
return min(left, right);
}
int range(int l, int r) {
return rec_range(0, 0, sz, l, r);
}
int low1(int idx, int lx, int rx, int l, int r, int val, int dir)
{
if(tree[idx]>=val||l>=rx||lx>=r) {
if(dir==0)
return -1;
return INF;
}
if(rx-lx==1) {
return lx;
}
int mid = (lx+rx)/2;
int id1, id2;
if(dir==1) {
id1 = low1(2*idx+1, lx, mid, l, r, val, dir);
if(id1>=l&&id1<r) {
return id1;
}
id2 = low1(2*idx+2, mid, rx, l, r, val, dir);
return min(id1, id2);
}
id2 = low1(2*idx+2, mid, rx, l, r, val, dir);
if(id2>=l&&id2<r) {
return id2;
}
id1 = low1(2*idx+1, lx, mid, l, r, val, dir);
return max(id1, id2);
}
int low1(int l, int r, int val, int dir)
{
return low1(0, 0, sz, l, r, val, dir);
}
};
vector<int> dp;
seg mint, maxt, st2;
map<int, int> ord;
vector<int> h;
int res = 0;
int center = -1;
vector<int> pref, left1, right1, difh;
int qcnt = 0;
seg2 st1;
void init2(int l, int r, int d)
{
int n = h.size();
res = 0;
for(int i=0; i<=n; i++) {
dp[i] = 0;
}
vector<int> used(n+1, 0);
vector<int> nums;
for(int i=l; i<=r; i++) {
int f1 = 0, f2 = 0;
nums.pub(h[i]);
nums.pub(h[i]-d);
nums.pub(h[i]+d);
if(i>l) {
if(h[i]>=h[i-1]) {
f1 = 1;
} else
{
f1 = 2;
}
}
if(i<r) {
if(h[i]>=h[i+1]) {
f2 = 1;
} else
{
f2 = 2;
}
}
if(f1==0) {
f1 = f2;
}
if(f2==0) {
f2 = f1;
}
if(f1==f2) {
used[i] = f1;
}
}
sort(nums.begin(), nums.end());
ord.clear();
ord[nums[0]] = 0;
int sz = nums.size();
for(int i=1; i<sz; i++) {
if(nums[i]>nums[i-1]) {
ord[nums[i]] = ord[nums[i-1]] + 1;
} else
{
ord[nums[i]] = ord[nums[i-1]];
}
}
mint.clean();
maxt.clean();
mint.build(sz);
maxt.build(sz);
for(int i=r; i>=l; i--) {
if(used[i]==0) {
continue;
}
if(used[i]==1&&h[i]-d>0) {
dp[i] = mint.range(0, ord[h[i]-d] + 1);
maxt.setX(ord[h[i]], dp[i]);
}
if(used[i]==2) {
dp[i] = 1 + maxt.range(ord[h[i]+d], sz);
mint.setX(ord[h[i]], dp[i]);
}
res = max(res, dp[i]);
}
}
void calc_pref()
{
int n = h.size();
pref.resize(n+1);
pref[0] = 0;
for(int i=1; i<=n; i++) {
pref[i] = pref[i-1];
if(i>1&&i<n) {
if(h[i-1]<h[i-2]&&h[i-1]<h[i]) {
pref[i]++;
}
} else if(i>1)
{
if(h[i-1]<h[i-2]) {
pref[i]++;
}
} else
{
if(h[i-1]<h[i]) {
pref[i]++;
}
}
}
}
void all_arr()
{
int n = h.size();
left1.resize(n, INF);
right1.resize(n, -1);
st1.build(n);
st2.build(n);
for(int i=0; i<n; i++) {
st1.setX(i, h[i]);
st2.setX(i, h[i]);
}
difh.resize(n);
for(int i=0; i<n; i++) {
pari p = {h[i], i};
left1[p.sc] = st1.low1(0, p.sc, p.fr, 0);
right1[p.sc] = st1.low1(p.sc + 1, n, p.fr, 1);
int h1 = 2*INF+10, h2 = h1;
if(left1[p.sc]!=-1) {
h1 = st2.range(left1[p.sc]+1, p.sc);
}
if(right1[p.sc]!=INF) {
h2 = st2.range(p.sc+1, right1[p.sc]);
} //cout<<h1<<endl;
difh[p.sc] = min(h1, h2) - p.fr;
}
sort(difh.begin(), difh.end());
}
void init(int n, vector<int> h2)
{
h.resize(n);
for(int i=0; i<n; i++) {
h[i] = h2[i];
}
dp.resize(n+1);
int idx = 1;
while(idx<n&&h[idx]>=h[idx-1]) {
idx++;
}
center = idx - 1;
while(idx<n&&h[idx]<=h[idx-1]) {
idx++;
}
calc_pref();
if(idx==n) {
return;
}
center = -1;
}
int max_towers(int l, int r, int d)
{
qcnt++;
int n = h.size();
if(n==1) {
return 1;
}
if(l==r) {
return 1;
}
if(center!=-1) {
if(r<=center||l>=center) {
return 1;
}
if(h[center]-h[l]>=d&&h[center]-h[r]>=d) {
return 2;
}
return 1;
}
if(d==1) {
if(pref.size()==0) {
calc_pref();
}
int ans = pref[r] - pref[l+1];
if(h[l]<h[l+1]) {
ans++;
}
if(h[r]<h[r-1]) {
ans++;
}
return ans;
}
/*
for(int i=0; i<n; i++) {
//cout<<left1[i]<<" ";
//cout<<right1[i]<<" ";
//cout<<difh[i]<<" ";
}
//cout<<endl;
*/
if(l==0&&r==h.size()-1) {
if(qcnt==1) {
all_arr();
}
int lo = 0, hi = n - 1;
while(lo<=hi) {
int mid = (lo+hi)/2;
if(difh[mid]>=d) {
hi = mid - 1;
} else
{
lo = mid + 1;
}
}
return n - lo;
}
if(qcnt==1) {
qcnt = 7;
init2(l, r, d);
return res;
}
return res;
}
/*
7
10 20 60 40 50 30 70
*/
/*
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//D(freopen("input.txt","r",stdin);)
//D(freopen("ouput.txt","w",stdout);)
int t = 1;
//cin >> t;
loop:
while(t--)
{
int n;
cin >> n;
vector<int> a(n);
for(int i=0; i<n; i++) {
cin >> a[i];
}
init(n, a);
int res = max_towers(0, 6, 10);
if(res==0) {
res = 1;
}
cout << res;
}
return 0;
}
*/
Compilation message
towers.cpp: In member function 'void seg::clean()':
towers.cpp:43:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
43 | for(int i=0; i<tree.size(); i++) {
| ~^~~~~~~~~~~~
towers.cpp: In member function 'void seg2::clean()':
towers.cpp:100:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
100 | for(int i=0; i<tree.size(); i++) {
| ~^~~~~~~~~~~~
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:376:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
376 | if(l==0&&r==h.size()-1) {
| ~^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
266 ms |
1448 KB |
Output is correct |
2 |
Correct |
560 ms |
2368 KB |
Output is correct |
3 |
Correct |
525 ms |
2392 KB |
Output is correct |
4 |
Correct |
531 ms |
2368 KB |
Output is correct |
5 |
Correct |
509 ms |
2364 KB |
Output is correct |
6 |
Correct |
575 ms |
2368 KB |
Output is correct |
7 |
Correct |
551 ms |
2368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
600 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
1 ms |
344 KB |
Output is correct |
29 |
Correct |
1 ms |
344 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
600 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
1 ms |
344 KB |
Output is correct |
29 |
Correct |
1 ms |
344 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
28 ms |
5464 KB |
Output is correct |
37 |
Correct |
51 ms |
9900 KB |
Output is correct |
38 |
Correct |
25 ms |
5328 KB |
Output is correct |
39 |
Correct |
46 ms |
9144 KB |
Output is correct |
40 |
Correct |
30 ms |
5320 KB |
Output is correct |
41 |
Correct |
149 ms |
19208 KB |
Output is correct |
42 |
Correct |
11 ms |
2748 KB |
Output is correct |
43 |
Correct |
9 ms |
2376 KB |
Output is correct |
44 |
Correct |
10 ms |
2544 KB |
Output is correct |
45 |
Correct |
11 ms |
2724 KB |
Output is correct |
46 |
Correct |
10 ms |
2752 KB |
Output is correct |
47 |
Correct |
10 ms |
2368 KB |
Output is correct |
48 |
Correct |
9 ms |
2376 KB |
Output is correct |
49 |
Correct |
9 ms |
2372 KB |
Output is correct |
50 |
Correct |
10 ms |
2544 KB |
Output is correct |
51 |
Correct |
9 ms |
2364 KB |
Output is correct |
52 |
Correct |
10 ms |
2392 KB |
Output is correct |
53 |
Correct |
11 ms |
2364 KB |
Output is correct |
54 |
Correct |
10 ms |
2392 KB |
Output is correct |
55 |
Correct |
10 ms |
2364 KB |
Output is correct |
56 |
Correct |
9 ms |
2372 KB |
Output is correct |
57 |
Correct |
62 ms |
5156 KB |
Output is correct |
58 |
Correct |
69 ms |
5344 KB |
Output is correct |
59 |
Correct |
69 ms |
5244 KB |
Output is correct |
60 |
Correct |
62 ms |
5300 KB |
Output is correct |
61 |
Correct |
66 ms |
5048 KB |
Output is correct |
62 |
Correct |
67 ms |
5284 KB |
Output is correct |
63 |
Correct |
63 ms |
5228 KB |
Output is correct |
64 |
Correct |
9 ms |
2364 KB |
Output is correct |
65 |
Correct |
9 ms |
2372 KB |
Output is correct |
66 |
Correct |
62 ms |
5220 KB |
Output is correct |
67 |
Correct |
51 ms |
5112 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
439 ms |
2364 KB |
Output is correct |
2 |
Correct |
568 ms |
2372 KB |
Output is correct |
3 |
Correct |
564 ms |
2372 KB |
Output is correct |
4 |
Correct |
578 ms |
2392 KB |
Output is correct |
5 |
Correct |
587 ms |
2368 KB |
Output is correct |
6 |
Correct |
625 ms |
2364 KB |
Output is correct |
7 |
Correct |
567 ms |
2368 KB |
Output is correct |
8 |
Correct |
538 ms |
2368 KB |
Output is correct |
9 |
Correct |
529 ms |
2364 KB |
Output is correct |
10 |
Correct |
565 ms |
2368 KB |
Output is correct |
11 |
Correct |
568 ms |
2368 KB |
Output is correct |
12 |
Correct |
575 ms |
2372 KB |
Output is correct |
13 |
Correct |
569 ms |
2372 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
10 ms |
2368 KB |
Output is correct |
18 |
Correct |
10 ms |
2368 KB |
Output is correct |
19 |
Correct |
9 ms |
2340 KB |
Output is correct |
20 |
Correct |
10 ms |
2364 KB |
Output is correct |
21 |
Correct |
9 ms |
2368 KB |
Output is correct |
22 |
Correct |
10 ms |
2392 KB |
Output is correct |
23 |
Correct |
9 ms |
2368 KB |
Output is correct |
24 |
Correct |
10 ms |
2544 KB |
Output is correct |
25 |
Correct |
9 ms |
2540 KB |
Output is correct |
26 |
Correct |
10 ms |
2364 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
0 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
178 ms |
1600 KB |
Output is correct |
2 |
Correct |
650 ms |
5076 KB |
Output is correct |
3 |
Correct |
673 ms |
5224 KB |
Output is correct |
4 |
Correct |
624 ms |
5048 KB |
Output is correct |
5 |
Correct |
659 ms |
5044 KB |
Output is correct |
6 |
Correct |
597 ms |
5024 KB |
Output is correct |
7 |
Correct |
657 ms |
5084 KB |
Output is correct |
8 |
Correct |
520 ms |
2392 KB |
Output is correct |
9 |
Correct |
539 ms |
2364 KB |
Output is correct |
10 |
Correct |
606 ms |
5052 KB |
Output is correct |
11 |
Correct |
557 ms |
5052 KB |
Output is correct |
12 |
Correct |
12 ms |
2364 KB |
Output is correct |
13 |
Correct |
12 ms |
2368 KB |
Output is correct |
14 |
Correct |
10 ms |
2372 KB |
Output is correct |
15 |
Correct |
14 ms |
2364 KB |
Output is correct |
16 |
Correct |
9 ms |
2368 KB |
Output is correct |
17 |
Correct |
63 ms |
5040 KB |
Output is correct |
18 |
Correct |
64 ms |
5040 KB |
Output is correct |
19 |
Correct |
64 ms |
5044 KB |
Output is correct |
20 |
Correct |
66 ms |
5336 KB |
Output is correct |
21 |
Correct |
63 ms |
5220 KB |
Output is correct |
22 |
Correct |
68 ms |
5044 KB |
Output is correct |
23 |
Correct |
66 ms |
5088 KB |
Output is correct |
24 |
Correct |
9 ms |
2212 KB |
Output is correct |
25 |
Correct |
12 ms |
2368 KB |
Output is correct |
26 |
Correct |
67 ms |
5284 KB |
Output is correct |
27 |
Correct |
51 ms |
5084 KB |
Output is correct |
28 |
Correct |
1 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
1 ms |
344 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
2 ms |
344 KB |
Output is correct |
40 |
Correct |
1 ms |
344 KB |
Output is correct |
41 |
Correct |
0 ms |
344 KB |
Output is correct |
42 |
Correct |
1 ms |
344 KB |
Output is correct |
43 |
Correct |
1 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
600 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
1 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
1 ms |
344 KB |
Output is correct |
29 |
Correct |
1 ms |
344 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
28 ms |
5464 KB |
Output is correct |
37 |
Correct |
51 ms |
9900 KB |
Output is correct |
38 |
Correct |
25 ms |
5328 KB |
Output is correct |
39 |
Correct |
46 ms |
9144 KB |
Output is correct |
40 |
Correct |
30 ms |
5320 KB |
Output is correct |
41 |
Correct |
149 ms |
19208 KB |
Output is correct |
42 |
Correct |
11 ms |
2748 KB |
Output is correct |
43 |
Correct |
9 ms |
2376 KB |
Output is correct |
44 |
Correct |
10 ms |
2544 KB |
Output is correct |
45 |
Correct |
11 ms |
2724 KB |
Output is correct |
46 |
Correct |
10 ms |
2752 KB |
Output is correct |
47 |
Correct |
10 ms |
2368 KB |
Output is correct |
48 |
Correct |
9 ms |
2376 KB |
Output is correct |
49 |
Correct |
9 ms |
2372 KB |
Output is correct |
50 |
Correct |
10 ms |
2544 KB |
Output is correct |
51 |
Correct |
9 ms |
2364 KB |
Output is correct |
52 |
Correct |
10 ms |
2392 KB |
Output is correct |
53 |
Correct |
11 ms |
2364 KB |
Output is correct |
54 |
Correct |
10 ms |
2392 KB |
Output is correct |
55 |
Correct |
10 ms |
2364 KB |
Output is correct |
56 |
Correct |
9 ms |
2372 KB |
Output is correct |
57 |
Correct |
62 ms |
5156 KB |
Output is correct |
58 |
Correct |
69 ms |
5344 KB |
Output is correct |
59 |
Correct |
69 ms |
5244 KB |
Output is correct |
60 |
Correct |
62 ms |
5300 KB |
Output is correct |
61 |
Correct |
66 ms |
5048 KB |
Output is correct |
62 |
Correct |
67 ms |
5284 KB |
Output is correct |
63 |
Correct |
63 ms |
5228 KB |
Output is correct |
64 |
Correct |
9 ms |
2364 KB |
Output is correct |
65 |
Correct |
9 ms |
2372 KB |
Output is correct |
66 |
Correct |
62 ms |
5220 KB |
Output is correct |
67 |
Correct |
51 ms |
5112 KB |
Output is correct |
68 |
Correct |
439 ms |
2364 KB |
Output is correct |
69 |
Correct |
568 ms |
2372 KB |
Output is correct |
70 |
Correct |
564 ms |
2372 KB |
Output is correct |
71 |
Correct |
578 ms |
2392 KB |
Output is correct |
72 |
Correct |
587 ms |
2368 KB |
Output is correct |
73 |
Correct |
625 ms |
2364 KB |
Output is correct |
74 |
Correct |
567 ms |
2368 KB |
Output is correct |
75 |
Correct |
538 ms |
2368 KB |
Output is correct |
76 |
Correct |
529 ms |
2364 KB |
Output is correct |
77 |
Correct |
565 ms |
2368 KB |
Output is correct |
78 |
Correct |
568 ms |
2368 KB |
Output is correct |
79 |
Correct |
575 ms |
2372 KB |
Output is correct |
80 |
Correct |
569 ms |
2372 KB |
Output is correct |
81 |
Correct |
0 ms |
344 KB |
Output is correct |
82 |
Correct |
0 ms |
344 KB |
Output is correct |
83 |
Correct |
0 ms |
344 KB |
Output is correct |
84 |
Correct |
10 ms |
2368 KB |
Output is correct |
85 |
Correct |
10 ms |
2368 KB |
Output is correct |
86 |
Correct |
9 ms |
2340 KB |
Output is correct |
87 |
Correct |
10 ms |
2364 KB |
Output is correct |
88 |
Correct |
9 ms |
2368 KB |
Output is correct |
89 |
Correct |
10 ms |
2392 KB |
Output is correct |
90 |
Correct |
9 ms |
2368 KB |
Output is correct |
91 |
Correct |
10 ms |
2544 KB |
Output is correct |
92 |
Correct |
9 ms |
2540 KB |
Output is correct |
93 |
Correct |
10 ms |
2364 KB |
Output is correct |
94 |
Correct |
1 ms |
344 KB |
Output is correct |
95 |
Correct |
0 ms |
344 KB |
Output is correct |
96 |
Correct |
0 ms |
344 KB |
Output is correct |
97 |
Correct |
0 ms |
344 KB |
Output is correct |
98 |
Correct |
1 ms |
344 KB |
Output is correct |
99 |
Correct |
1 ms |
340 KB |
Output is correct |
100 |
Correct |
1 ms |
344 KB |
Output is correct |
101 |
Correct |
0 ms |
344 KB |
Output is correct |
102 |
Correct |
0 ms |
344 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Incorrect |
506 ms |
8048 KB |
2nd lines differ - on the 1st token, expected: '18702', found: '7293' |
105 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
266 ms |
1448 KB |
Output is correct |
2 |
Correct |
560 ms |
2368 KB |
Output is correct |
3 |
Correct |
525 ms |
2392 KB |
Output is correct |
4 |
Correct |
531 ms |
2368 KB |
Output is correct |
5 |
Correct |
509 ms |
2364 KB |
Output is correct |
6 |
Correct |
575 ms |
2368 KB |
Output is correct |
7 |
Correct |
551 ms |
2368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
600 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
600 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
344 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
1 ms |
344 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
1 ms |
344 KB |
Output is correct |
40 |
Correct |
1 ms |
344 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
1 ms |
344 KB |
Output is correct |
43 |
Correct |
1 ms |
344 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
28 ms |
5464 KB |
Output is correct |
47 |
Correct |
51 ms |
9900 KB |
Output is correct |
48 |
Correct |
25 ms |
5328 KB |
Output is correct |
49 |
Correct |
46 ms |
9144 KB |
Output is correct |
50 |
Correct |
30 ms |
5320 KB |
Output is correct |
51 |
Correct |
149 ms |
19208 KB |
Output is correct |
52 |
Correct |
11 ms |
2748 KB |
Output is correct |
53 |
Correct |
9 ms |
2376 KB |
Output is correct |
54 |
Correct |
10 ms |
2544 KB |
Output is correct |
55 |
Correct |
11 ms |
2724 KB |
Output is correct |
56 |
Correct |
10 ms |
2752 KB |
Output is correct |
57 |
Correct |
10 ms |
2368 KB |
Output is correct |
58 |
Correct |
9 ms |
2376 KB |
Output is correct |
59 |
Correct |
9 ms |
2372 KB |
Output is correct |
60 |
Correct |
10 ms |
2544 KB |
Output is correct |
61 |
Correct |
9 ms |
2364 KB |
Output is correct |
62 |
Correct |
10 ms |
2392 KB |
Output is correct |
63 |
Correct |
11 ms |
2364 KB |
Output is correct |
64 |
Correct |
10 ms |
2392 KB |
Output is correct |
65 |
Correct |
10 ms |
2364 KB |
Output is correct |
66 |
Correct |
9 ms |
2372 KB |
Output is correct |
67 |
Correct |
62 ms |
5156 KB |
Output is correct |
68 |
Correct |
69 ms |
5344 KB |
Output is correct |
69 |
Correct |
69 ms |
5244 KB |
Output is correct |
70 |
Correct |
62 ms |
5300 KB |
Output is correct |
71 |
Correct |
66 ms |
5048 KB |
Output is correct |
72 |
Correct |
67 ms |
5284 KB |
Output is correct |
73 |
Correct |
63 ms |
5228 KB |
Output is correct |
74 |
Correct |
9 ms |
2364 KB |
Output is correct |
75 |
Correct |
9 ms |
2372 KB |
Output is correct |
76 |
Correct |
62 ms |
5220 KB |
Output is correct |
77 |
Correct |
51 ms |
5112 KB |
Output is correct |
78 |
Correct |
439 ms |
2364 KB |
Output is correct |
79 |
Correct |
568 ms |
2372 KB |
Output is correct |
80 |
Correct |
564 ms |
2372 KB |
Output is correct |
81 |
Correct |
578 ms |
2392 KB |
Output is correct |
82 |
Correct |
587 ms |
2368 KB |
Output is correct |
83 |
Correct |
625 ms |
2364 KB |
Output is correct |
84 |
Correct |
567 ms |
2368 KB |
Output is correct |
85 |
Correct |
538 ms |
2368 KB |
Output is correct |
86 |
Correct |
529 ms |
2364 KB |
Output is correct |
87 |
Correct |
565 ms |
2368 KB |
Output is correct |
88 |
Correct |
568 ms |
2368 KB |
Output is correct |
89 |
Correct |
575 ms |
2372 KB |
Output is correct |
90 |
Correct |
569 ms |
2372 KB |
Output is correct |
91 |
Correct |
0 ms |
344 KB |
Output is correct |
92 |
Correct |
0 ms |
344 KB |
Output is correct |
93 |
Correct |
0 ms |
344 KB |
Output is correct |
94 |
Correct |
10 ms |
2368 KB |
Output is correct |
95 |
Correct |
10 ms |
2368 KB |
Output is correct |
96 |
Correct |
9 ms |
2340 KB |
Output is correct |
97 |
Correct |
10 ms |
2364 KB |
Output is correct |
98 |
Correct |
9 ms |
2368 KB |
Output is correct |
99 |
Correct |
10 ms |
2392 KB |
Output is correct |
100 |
Correct |
9 ms |
2368 KB |
Output is correct |
101 |
Correct |
10 ms |
2544 KB |
Output is correct |
102 |
Correct |
9 ms |
2540 KB |
Output is correct |
103 |
Correct |
10 ms |
2364 KB |
Output is correct |
104 |
Correct |
1 ms |
344 KB |
Output is correct |
105 |
Correct |
0 ms |
344 KB |
Output is correct |
106 |
Correct |
0 ms |
344 KB |
Output is correct |
107 |
Correct |
0 ms |
344 KB |
Output is correct |
108 |
Correct |
1 ms |
344 KB |
Output is correct |
109 |
Correct |
1 ms |
340 KB |
Output is correct |
110 |
Correct |
1 ms |
344 KB |
Output is correct |
111 |
Correct |
0 ms |
344 KB |
Output is correct |
112 |
Correct |
0 ms |
344 KB |
Output is correct |
113 |
Correct |
0 ms |
344 KB |
Output is correct |
114 |
Correct |
178 ms |
1600 KB |
Output is correct |
115 |
Correct |
650 ms |
5076 KB |
Output is correct |
116 |
Correct |
673 ms |
5224 KB |
Output is correct |
117 |
Correct |
624 ms |
5048 KB |
Output is correct |
118 |
Correct |
659 ms |
5044 KB |
Output is correct |
119 |
Correct |
597 ms |
5024 KB |
Output is correct |
120 |
Correct |
657 ms |
5084 KB |
Output is correct |
121 |
Correct |
520 ms |
2392 KB |
Output is correct |
122 |
Correct |
539 ms |
2364 KB |
Output is correct |
123 |
Correct |
606 ms |
5052 KB |
Output is correct |
124 |
Correct |
557 ms |
5052 KB |
Output is correct |
125 |
Correct |
12 ms |
2364 KB |
Output is correct |
126 |
Correct |
12 ms |
2368 KB |
Output is correct |
127 |
Correct |
10 ms |
2372 KB |
Output is correct |
128 |
Correct |
14 ms |
2364 KB |
Output is correct |
129 |
Correct |
9 ms |
2368 KB |
Output is correct |
130 |
Correct |
63 ms |
5040 KB |
Output is correct |
131 |
Correct |
64 ms |
5040 KB |
Output is correct |
132 |
Correct |
64 ms |
5044 KB |
Output is correct |
133 |
Correct |
66 ms |
5336 KB |
Output is correct |
134 |
Correct |
63 ms |
5220 KB |
Output is correct |
135 |
Correct |
68 ms |
5044 KB |
Output is correct |
136 |
Correct |
66 ms |
5088 KB |
Output is correct |
137 |
Correct |
9 ms |
2212 KB |
Output is correct |
138 |
Correct |
12 ms |
2368 KB |
Output is correct |
139 |
Correct |
67 ms |
5284 KB |
Output is correct |
140 |
Correct |
51 ms |
5084 KB |
Output is correct |
141 |
Correct |
1 ms |
344 KB |
Output is correct |
142 |
Correct |
0 ms |
344 KB |
Output is correct |
143 |
Correct |
0 ms |
344 KB |
Output is correct |
144 |
Correct |
0 ms |
344 KB |
Output is correct |
145 |
Correct |
1 ms |
344 KB |
Output is correct |
146 |
Correct |
1 ms |
344 KB |
Output is correct |
147 |
Correct |
1 ms |
344 KB |
Output is correct |
148 |
Correct |
1 ms |
344 KB |
Output is correct |
149 |
Correct |
1 ms |
344 KB |
Output is correct |
150 |
Correct |
1 ms |
344 KB |
Output is correct |
151 |
Correct |
1 ms |
344 KB |
Output is correct |
152 |
Correct |
2 ms |
344 KB |
Output is correct |
153 |
Correct |
1 ms |
344 KB |
Output is correct |
154 |
Correct |
0 ms |
344 KB |
Output is correct |
155 |
Correct |
1 ms |
344 KB |
Output is correct |
156 |
Correct |
1 ms |
600 KB |
Output is correct |
157 |
Incorrect |
506 ms |
8048 KB |
2nd lines differ - on the 1st token, expected: '18702', found: '7293' |
158 |
Halted |
0 ms |
0 KB |
- |