#include<bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
typedef long long int ll;
const ll inf=1e18;
ll n,m,i,j,k,l,r,x,y,z,w,t,range[1100000];
ll sum1[1100000],sum2[1100000],dp[1100000],add_cost[1100000],cost[1100000],c[1100000],d[1100000],seg[2200000],lazy[2200000],a[1100000],b[1100000],s;
vector<int> del_list[1100000],v;
set<pair<int,int>> chain;
pair<ll,ll> p,q;
#include <cassert>
#include <cstdio>
#include <cinttypes>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
class strictInput
{
char *p;
off_t cur = 0;
off_t len = 0;
public:
explicit strictInput(int fd = 0)
{
struct stat st;
fstat(fd, &st);
p = (char *)mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
len = st.st_size;
}
char readChar()
{
assert(cur != len);
return p[cur++];
}
void unreadChar()
{
assert(cur != 0);
--cur;
}
bool isEOF() { return cur == len; }
void readEOF() { assert(isEOF()); }
void readSpace() { assert(readChar() == ' '); }
void readEoln() { assert(readChar() == '\n'); }
// reads uint64_t in range [from, to]
uint64_t readU64(uint64_t from = 0, uint64_t to = UINT64_MAX)
{
uint64_t cur = 0;
off_t read_cnt = 0;
bool leading_zero = false;
while (!isEOF())
{
char p = readChar();
if (!('0' <= p && p <= '9'))
{
unreadChar();
break;
}
uint64_t v = p - '0';
assert(cur <= UINT64_MAX / 10);
cur *= 10;
assert(cur <= UINT64_MAX - v);
cur += v;
if (read_cnt == 0 && v == 0)
leading_zero = true;
++read_cnt;
}
if (cur == 0)
assert(read_cnt == 1);
else
assert(!leading_zero);
return cur;
}
// reads int64_t in range [from, to]
int64_t readI64(int64_t from = INT64_MIN, int64_t to = INT64_MAX)
{
uint64_t cur = 0;
off_t read_cnt = 0;
bool leading_zero = false;
bool leading_minus = readChar() == '-';
if (!leading_minus)
unreadChar();
while (!isEOF())
{
char p = readChar();
if (!('0' <= p && p <= '9'))
{
unreadChar();
break;
}
uint64_t v = p - '0';
assert(cur <= UINT64_MAX / 10);
cur *= 10;
assert(cur <= UINT64_MAX - v);
cur += v;
if (read_cnt == 0 && v == 0)
leading_zero = true;
++read_cnt;
}
if (cur == 0)
assert(read_cnt == 1 && !leading_minus);
else
assert(!leading_zero);
if (cur <= INT64_MAX)
{
int64_t ret = cur;
if (leading_minus)
ret = -ret;
return ret;
}
else
{
assert(leading_minus && cur == uint64_t(INT64_MIN));
return INT64_MIN;
}
}
};
pair<int,int> find_chain(int x)
{
pair<int,int> p=*(--chain.lower_bound(make_pair(x,m+10)));
return p;
}
/*void propagate(int x,int y,int z)
{
if(z<1048576)
{
lazy[z*2]+=lazy[z];
lazy[z*2+1]+=lazy[z];
}
seg[z]+=lazy[z];
lazy[z]=0;
}
void f(int x,int y,int z,ll w)
{
propagate(x,y,z);
if(y<l||x>r)
return;
if(l<=x&&y<=r)
{
lazy[z]+=w;
propagate(x,y,z);
return;
}
f(x,(x+y)/2,z*2,w);
f((x+y)/2+1,y,z*2+1,w);
seg[z]=max(seg[z*2],seg[z*2+1]);
}
ll g(int x,int y,int z)
{
propagate(x,y,z);
if(y<l||x>r)
{
return -inf;
}
if(l<=x&&y<=r)
{
return seg[z];
}
return max(g(x,(x+y)/2,z*2),g((x+y)/2+1,y,z*2+1));
}*/
void f(ll x)
{
while(x)
{seg[x]=seg[x<<1]+seg[(x<<1)+1];
x>>=1;
}
}
/*ll g(ll x,ll y,ll z)
{
if(y<l||x>r)
return 0;
if(l<=x&&y<=r)
return seg[z];
return g(x,(x+y)>>1,z<<1)+g(((x+y)>>1)+1,y,(z<<1)+1);
}*/
ll g(ll x,ll y,ll z) {
x=l;
y=r;
ll res = 0;
for(x+=1048575,y+=1048575; x<=y; x>>=1,y>>=1) {
if(x&1) res += seg[x--];
if(~y&1) res += seg[y--];
}
return res;
}
void add(int x,int y,ll z)
{
/*l=x+1;
r=y+1;
f(1,1048576,1,z);*/
l=x+1;
seg[l+1048575]+=z;
f((l+1048575)/2);
l=y+2;
seg[l+1048575]-=z;
f((l+1048575)/2);
}
ll get_val(int x)
{
//l=x+1;
l=1;
r=x+1;
return g(1,1048576,1);
}
void reconstruct_chain(int x)
{
pair<int,int> p=find_chain(x);
while(chain.upper_bound(p)!=chain.end())
{
pair<int,int> q=(*chain.upper_bound(p));
y=get_val(p.second);
z=get_val(q.first);
//printf("(%lld,%lld,%lld,%lld)\n",p.first,p.second,q.first,q.second);
if(z<=y+cost[p.second])
{
add(q.first,q.second,y+cost[p.second]-z);
chain.erase(p);
chain.erase(q);
chain.insert({p.first,q.second});
p.second=q.second;
}
else
return;
}
}
/*void show()
{
return;
ll i;
for(i=0;i<=m;i++)
printf("%lld ",get_val(i));
printf("\n");
}
void init(){
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
}*/
int main()
{
strictInput inp;
//cin >> n >> m;
n=inp.readI64(-inf,inf);
inp.readSpace();
m=inp.readI64(-inf,inf);
inp.readEoln();
for(i=1;i<=n;i++)
{
// scanf("%lld %lld %lld",&a[i],&c[i],&add_cost[i]);
//cin >> a[i] >> c[i] >> add_cost[i];
a[i]=inp.readI64(-inf,inf);inp.readSpace();
c[i]=inp.readI64(-inf,inf);inp.readSpace();
add_cost[i]=inp.readI64(-inf,inf);inp.readEoln();
sum1[i]=sum1[i-1]+a[i];
}
for(i=1;i<=m;i++)
{
//scanf("%lld %lld %lld",&b[i],&d[i],&cost[i-1]);
//cin >> b[i] >> d[i] >> cost[i-1];
b[i]=inp.readI64(-inf,inf);inp.readSpace();
d[i]=inp.readI64(-inf,inf);inp.readSpace();
cost[i-1]=inp.readI64(-inf,inf);inp.readEoln();
sum2[i]=sum2[i-1]+b[i];
}
for(i=1;i<=n;i++)
{
range[i]=upper_bound(sum2,sum2+m+1,c[i]-sum1[i])-sum2-1;
//printf("(%lld) ",range[i]);
}
//printf("\n");
for(i=1;i<=m;i++)
{
x=upper_bound(sum1,sum1+n+1,d[i]-sum2[i])-sum1;
del_list[x].push_back(i-1);
//printf("(%lld)",x);
}
//printf("\n");
for(auto xx:del_list[0])
{
cost[xx]=0;
}
for(i=1;i<=m;i++)
{
dp[i]=dp[i-1]+cost[i-1];
}
for(i=0;i<=m;i++)
{
add(i,i,dp[i]);
}
/*for(i=0;i<=m;i++)
{
printf("(%lld)",cost[i]);
}
printf("\n");
*/chain.insert({0,m});
for(i=1;i<=n;i++)
{
v.clear();
for(auto xx:del_list[i])
{
p=find_chain(xx);
chain.erase(p);
chain.insert({p.first,xx});
if(xx+1<=p.second)
chain.insert({xx+1,p.second});
cost[xx]=0;
v.push_back(xx);
}
x=range[i];
p=find_chain(x);
if(x>=0)
{
chain.erase(p);
chain.insert({p.first,x});
if(x+1<=p.second)
chain.insert({x+1,p.second});
add(0,x,add_cost[i]);
v.push_back(x);
}
sort(v.begin(),v.end());
for(j=0;j<v.size();j++)
reconstruct_chain(v[j]);
}
s=-inf;
for(i=m;i<=m;i++)
{
s=max(s,get_val(i));
}
printf("%lld",s);
}
Compilation message
dishes.cpp: In function 'int main()':
dishes.cpp:328:18: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
328 | for(j=0;j<v.size();j++)
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
229 ms |
70844 KB |
Output is correct |
2 |
Correct |
175 ms |
62364 KB |
Output is correct |
3 |
Correct |
89 ms |
59268 KB |
Output is correct |
4 |
Correct |
222 ms |
68308 KB |
Output is correct |
5 |
Correct |
9 ms |
26200 KB |
Output is correct |
6 |
Correct |
220 ms |
60868 KB |
Output is correct |
7 |
Correct |
38 ms |
44832 KB |
Output is correct |
8 |
Correct |
81 ms |
41060 KB |
Output is correct |
9 |
Correct |
87 ms |
60356 KB |
Output is correct |
10 |
Correct |
214 ms |
58712 KB |
Output is correct |
11 |
Correct |
77 ms |
53704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
26200 KB |
Output is correct |
2 |
Correct |
10 ms |
26204 KB |
Output is correct |
3 |
Correct |
10 ms |
26204 KB |
Output is correct |
4 |
Correct |
10 ms |
26204 KB |
Output is correct |
5 |
Correct |
10 ms |
26204 KB |
Output is correct |
6 |
Correct |
10 ms |
26264 KB |
Output is correct |
7 |
Correct |
10 ms |
26204 KB |
Output is correct |
8 |
Correct |
9 ms |
26204 KB |
Output is correct |
9 |
Correct |
9 ms |
26252 KB |
Output is correct |
10 |
Correct |
9 ms |
26204 KB |
Output is correct |
11 |
Correct |
9 ms |
26204 KB |
Output is correct |
12 |
Correct |
10 ms |
26404 KB |
Output is correct |
13 |
Correct |
9 ms |
26204 KB |
Output is correct |
14 |
Correct |
9 ms |
26204 KB |
Output is correct |
15 |
Correct |
9 ms |
26204 KB |
Output is correct |
16 |
Correct |
9 ms |
26204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
26200 KB |
Output is correct |
2 |
Correct |
10 ms |
26204 KB |
Output is correct |
3 |
Correct |
10 ms |
26204 KB |
Output is correct |
4 |
Correct |
10 ms |
26204 KB |
Output is correct |
5 |
Correct |
10 ms |
26204 KB |
Output is correct |
6 |
Correct |
10 ms |
26264 KB |
Output is correct |
7 |
Correct |
10 ms |
26204 KB |
Output is correct |
8 |
Correct |
9 ms |
26204 KB |
Output is correct |
9 |
Correct |
9 ms |
26252 KB |
Output is correct |
10 |
Correct |
9 ms |
26204 KB |
Output is correct |
11 |
Correct |
9 ms |
26204 KB |
Output is correct |
12 |
Correct |
10 ms |
26404 KB |
Output is correct |
13 |
Correct |
9 ms |
26204 KB |
Output is correct |
14 |
Correct |
9 ms |
26204 KB |
Output is correct |
15 |
Correct |
9 ms |
26204 KB |
Output is correct |
16 |
Correct |
9 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26712 KB |
Output is correct |
18 |
Correct |
11 ms |
26716 KB |
Output is correct |
19 |
Correct |
12 ms |
26716 KB |
Output is correct |
20 |
Correct |
11 ms |
26608 KB |
Output is correct |
21 |
Correct |
15 ms |
26776 KB |
Output is correct |
22 |
Correct |
14 ms |
26456 KB |
Output is correct |
23 |
Correct |
14 ms |
26460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
26200 KB |
Output is correct |
2 |
Correct |
10 ms |
26204 KB |
Output is correct |
3 |
Correct |
10 ms |
26204 KB |
Output is correct |
4 |
Correct |
10 ms |
26204 KB |
Output is correct |
5 |
Correct |
10 ms |
26204 KB |
Output is correct |
6 |
Correct |
10 ms |
26264 KB |
Output is correct |
7 |
Correct |
10 ms |
26204 KB |
Output is correct |
8 |
Correct |
9 ms |
26204 KB |
Output is correct |
9 |
Correct |
9 ms |
26252 KB |
Output is correct |
10 |
Correct |
9 ms |
26204 KB |
Output is correct |
11 |
Correct |
9 ms |
26204 KB |
Output is correct |
12 |
Correct |
10 ms |
26404 KB |
Output is correct |
13 |
Correct |
9 ms |
26204 KB |
Output is correct |
14 |
Correct |
9 ms |
26204 KB |
Output is correct |
15 |
Correct |
9 ms |
26204 KB |
Output is correct |
16 |
Correct |
9 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26712 KB |
Output is correct |
18 |
Correct |
11 ms |
26716 KB |
Output is correct |
19 |
Correct |
12 ms |
26716 KB |
Output is correct |
20 |
Correct |
11 ms |
26608 KB |
Output is correct |
21 |
Correct |
15 ms |
26776 KB |
Output is correct |
22 |
Correct |
14 ms |
26456 KB |
Output is correct |
23 |
Correct |
14 ms |
26460 KB |
Output is correct |
24 |
Correct |
139 ms |
56688 KB |
Output is correct |
25 |
Correct |
267 ms |
66632 KB |
Output is correct |
26 |
Correct |
141 ms |
56708 KB |
Output is correct |
27 |
Correct |
270 ms |
71504 KB |
Output is correct |
28 |
Correct |
198 ms |
57804 KB |
Output is correct |
29 |
Correct |
85 ms |
57284 KB |
Output is correct |
30 |
Correct |
494 ms |
59728 KB |
Output is correct |
31 |
Correct |
118 ms |
48396 KB |
Output is correct |
32 |
Correct |
106 ms |
39248 KB |
Output is correct |
33 |
Correct |
301 ms |
58052 KB |
Output is correct |
34 |
Correct |
406 ms |
61784 KB |
Output is correct |
35 |
Correct |
545 ms |
53684 KB |
Output is correct |
36 |
Correct |
519 ms |
53460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
26200 KB |
Output is correct |
2 |
Correct |
10 ms |
26204 KB |
Output is correct |
3 |
Correct |
10 ms |
26204 KB |
Output is correct |
4 |
Correct |
10 ms |
26204 KB |
Output is correct |
5 |
Correct |
10 ms |
26204 KB |
Output is correct |
6 |
Correct |
10 ms |
26264 KB |
Output is correct |
7 |
Correct |
10 ms |
26204 KB |
Output is correct |
8 |
Correct |
9 ms |
26204 KB |
Output is correct |
9 |
Correct |
9 ms |
26252 KB |
Output is correct |
10 |
Correct |
9 ms |
26204 KB |
Output is correct |
11 |
Correct |
9 ms |
26204 KB |
Output is correct |
12 |
Correct |
10 ms |
26404 KB |
Output is correct |
13 |
Correct |
9 ms |
26204 KB |
Output is correct |
14 |
Correct |
9 ms |
26204 KB |
Output is correct |
15 |
Correct |
9 ms |
26204 KB |
Output is correct |
16 |
Correct |
9 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26712 KB |
Output is correct |
18 |
Correct |
11 ms |
26716 KB |
Output is correct |
19 |
Correct |
12 ms |
26716 KB |
Output is correct |
20 |
Correct |
11 ms |
26608 KB |
Output is correct |
21 |
Correct |
15 ms |
26776 KB |
Output is correct |
22 |
Correct |
14 ms |
26456 KB |
Output is correct |
23 |
Correct |
14 ms |
26460 KB |
Output is correct |
24 |
Correct |
139 ms |
56688 KB |
Output is correct |
25 |
Correct |
267 ms |
66632 KB |
Output is correct |
26 |
Correct |
141 ms |
56708 KB |
Output is correct |
27 |
Correct |
270 ms |
71504 KB |
Output is correct |
28 |
Correct |
198 ms |
57804 KB |
Output is correct |
29 |
Correct |
85 ms |
57284 KB |
Output is correct |
30 |
Correct |
494 ms |
59728 KB |
Output is correct |
31 |
Correct |
118 ms |
48396 KB |
Output is correct |
32 |
Correct |
106 ms |
39248 KB |
Output is correct |
33 |
Correct |
301 ms |
58052 KB |
Output is correct |
34 |
Correct |
406 ms |
61784 KB |
Output is correct |
35 |
Correct |
545 ms |
53684 KB |
Output is correct |
36 |
Correct |
519 ms |
53460 KB |
Output is correct |
37 |
Correct |
143 ms |
59652 KB |
Output is correct |
38 |
Correct |
260 ms |
74320 KB |
Output is correct |
39 |
Correct |
439 ms |
71772 KB |
Output is correct |
40 |
Correct |
170 ms |
62288 KB |
Output is correct |
41 |
Correct |
9 ms |
26364 KB |
Output is correct |
42 |
Correct |
590 ms |
62924 KB |
Output is correct |
43 |
Correct |
332 ms |
61196 KB |
Output is correct |
44 |
Correct |
431 ms |
64620 KB |
Output is correct |
45 |
Correct |
570 ms |
56660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
26200 KB |
Output is correct |
2 |
Correct |
10 ms |
26204 KB |
Output is correct |
3 |
Correct |
10 ms |
26204 KB |
Output is correct |
4 |
Correct |
10 ms |
26204 KB |
Output is correct |
5 |
Correct |
10 ms |
26204 KB |
Output is correct |
6 |
Correct |
10 ms |
26264 KB |
Output is correct |
7 |
Correct |
10 ms |
26204 KB |
Output is correct |
8 |
Correct |
9 ms |
26204 KB |
Output is correct |
9 |
Correct |
9 ms |
26252 KB |
Output is correct |
10 |
Correct |
9 ms |
26204 KB |
Output is correct |
11 |
Correct |
9 ms |
26204 KB |
Output is correct |
12 |
Correct |
10 ms |
26404 KB |
Output is correct |
13 |
Correct |
9 ms |
26204 KB |
Output is correct |
14 |
Correct |
9 ms |
26204 KB |
Output is correct |
15 |
Correct |
9 ms |
26204 KB |
Output is correct |
16 |
Correct |
9 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26712 KB |
Output is correct |
18 |
Correct |
11 ms |
26716 KB |
Output is correct |
19 |
Correct |
12 ms |
26716 KB |
Output is correct |
20 |
Correct |
11 ms |
26608 KB |
Output is correct |
21 |
Correct |
15 ms |
26776 KB |
Output is correct |
22 |
Correct |
14 ms |
26456 KB |
Output is correct |
23 |
Correct |
14 ms |
26460 KB |
Output is correct |
24 |
Correct |
139 ms |
56688 KB |
Output is correct |
25 |
Correct |
267 ms |
66632 KB |
Output is correct |
26 |
Correct |
141 ms |
56708 KB |
Output is correct |
27 |
Correct |
270 ms |
71504 KB |
Output is correct |
28 |
Correct |
198 ms |
57804 KB |
Output is correct |
29 |
Correct |
85 ms |
57284 KB |
Output is correct |
30 |
Correct |
494 ms |
59728 KB |
Output is correct |
31 |
Correct |
118 ms |
48396 KB |
Output is correct |
32 |
Correct |
106 ms |
39248 KB |
Output is correct |
33 |
Correct |
301 ms |
58052 KB |
Output is correct |
34 |
Correct |
406 ms |
61784 KB |
Output is correct |
35 |
Correct |
545 ms |
53684 KB |
Output is correct |
36 |
Correct |
519 ms |
53460 KB |
Output is correct |
37 |
Correct |
143 ms |
59652 KB |
Output is correct |
38 |
Correct |
260 ms |
74320 KB |
Output is correct |
39 |
Correct |
439 ms |
71772 KB |
Output is correct |
40 |
Correct |
170 ms |
62288 KB |
Output is correct |
41 |
Correct |
9 ms |
26364 KB |
Output is correct |
42 |
Correct |
590 ms |
62924 KB |
Output is correct |
43 |
Correct |
332 ms |
61196 KB |
Output is correct |
44 |
Correct |
431 ms |
64620 KB |
Output is correct |
45 |
Correct |
570 ms |
56660 KB |
Output is correct |
46 |
Correct |
672 ms |
194260 KB |
Output is correct |
47 |
Correct |
1509 ms |
268396 KB |
Output is correct |
48 |
Correct |
2317 ms |
254624 KB |
Output is correct |
49 |
Correct |
799 ms |
207884 KB |
Output is correct |
50 |
Correct |
3110 ms |
210172 KB |
Output is correct |
51 |
Correct |
1611 ms |
198632 KB |
Output is correct |
52 |
Correct |
2197 ms |
212260 KB |
Output is correct |
53 |
Correct |
3029 ms |
178632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
229 ms |
70844 KB |
Output is correct |
2 |
Correct |
175 ms |
62364 KB |
Output is correct |
3 |
Correct |
89 ms |
59268 KB |
Output is correct |
4 |
Correct |
222 ms |
68308 KB |
Output is correct |
5 |
Correct |
9 ms |
26200 KB |
Output is correct |
6 |
Correct |
220 ms |
60868 KB |
Output is correct |
7 |
Correct |
38 ms |
44832 KB |
Output is correct |
8 |
Correct |
81 ms |
41060 KB |
Output is correct |
9 |
Correct |
87 ms |
60356 KB |
Output is correct |
10 |
Correct |
214 ms |
58712 KB |
Output is correct |
11 |
Correct |
77 ms |
53704 KB |
Output is correct |
12 |
Correct |
9 ms |
26200 KB |
Output is correct |
13 |
Correct |
10 ms |
26204 KB |
Output is correct |
14 |
Correct |
10 ms |
26204 KB |
Output is correct |
15 |
Correct |
10 ms |
26204 KB |
Output is correct |
16 |
Correct |
10 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26264 KB |
Output is correct |
18 |
Correct |
10 ms |
26204 KB |
Output is correct |
19 |
Correct |
9 ms |
26204 KB |
Output is correct |
20 |
Correct |
9 ms |
26252 KB |
Output is correct |
21 |
Correct |
9 ms |
26204 KB |
Output is correct |
22 |
Correct |
9 ms |
26204 KB |
Output is correct |
23 |
Correct |
10 ms |
26404 KB |
Output is correct |
24 |
Correct |
9 ms |
26204 KB |
Output is correct |
25 |
Correct |
9 ms |
26204 KB |
Output is correct |
26 |
Correct |
9 ms |
26204 KB |
Output is correct |
27 |
Correct |
9 ms |
26204 KB |
Output is correct |
28 |
Correct |
10 ms |
26712 KB |
Output is correct |
29 |
Correct |
11 ms |
26716 KB |
Output is correct |
30 |
Correct |
12 ms |
26716 KB |
Output is correct |
31 |
Correct |
11 ms |
26608 KB |
Output is correct |
32 |
Correct |
15 ms |
26776 KB |
Output is correct |
33 |
Correct |
14 ms |
26456 KB |
Output is correct |
34 |
Correct |
14 ms |
26460 KB |
Output is correct |
35 |
Correct |
139 ms |
56688 KB |
Output is correct |
36 |
Correct |
267 ms |
66632 KB |
Output is correct |
37 |
Correct |
141 ms |
56708 KB |
Output is correct |
38 |
Correct |
270 ms |
71504 KB |
Output is correct |
39 |
Correct |
198 ms |
57804 KB |
Output is correct |
40 |
Correct |
85 ms |
57284 KB |
Output is correct |
41 |
Correct |
494 ms |
59728 KB |
Output is correct |
42 |
Correct |
118 ms |
48396 KB |
Output is correct |
43 |
Correct |
106 ms |
39248 KB |
Output is correct |
44 |
Correct |
301 ms |
58052 KB |
Output is correct |
45 |
Correct |
406 ms |
61784 KB |
Output is correct |
46 |
Correct |
545 ms |
53684 KB |
Output is correct |
47 |
Correct |
519 ms |
53460 KB |
Output is correct |
48 |
Correct |
143 ms |
59652 KB |
Output is correct |
49 |
Correct |
260 ms |
74320 KB |
Output is correct |
50 |
Correct |
439 ms |
71772 KB |
Output is correct |
51 |
Correct |
170 ms |
62288 KB |
Output is correct |
52 |
Correct |
9 ms |
26364 KB |
Output is correct |
53 |
Correct |
590 ms |
62924 KB |
Output is correct |
54 |
Correct |
332 ms |
61196 KB |
Output is correct |
55 |
Correct |
431 ms |
64620 KB |
Output is correct |
56 |
Correct |
570 ms |
56660 KB |
Output is correct |
57 |
Correct |
222 ms |
69464 KB |
Output is correct |
58 |
Correct |
149 ms |
65360 KB |
Output is correct |
59 |
Correct |
169 ms |
63312 KB |
Output is correct |
60 |
Correct |
407 ms |
72784 KB |
Output is correct |
61 |
Correct |
263 ms |
59732 KB |
Output is correct |
62 |
Correct |
10 ms |
26204 KB |
Output is correct |
63 |
Correct |
551 ms |
63112 KB |
Output is correct |
64 |
Correct |
311 ms |
61020 KB |
Output is correct |
65 |
Correct |
420 ms |
61620 KB |
Output is correct |
66 |
Correct |
521 ms |
56508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
229 ms |
70844 KB |
Output is correct |
2 |
Correct |
175 ms |
62364 KB |
Output is correct |
3 |
Correct |
89 ms |
59268 KB |
Output is correct |
4 |
Correct |
222 ms |
68308 KB |
Output is correct |
5 |
Correct |
9 ms |
26200 KB |
Output is correct |
6 |
Correct |
220 ms |
60868 KB |
Output is correct |
7 |
Correct |
38 ms |
44832 KB |
Output is correct |
8 |
Correct |
81 ms |
41060 KB |
Output is correct |
9 |
Correct |
87 ms |
60356 KB |
Output is correct |
10 |
Correct |
214 ms |
58712 KB |
Output is correct |
11 |
Correct |
77 ms |
53704 KB |
Output is correct |
12 |
Correct |
9 ms |
26200 KB |
Output is correct |
13 |
Correct |
10 ms |
26204 KB |
Output is correct |
14 |
Correct |
10 ms |
26204 KB |
Output is correct |
15 |
Correct |
10 ms |
26204 KB |
Output is correct |
16 |
Correct |
10 ms |
26204 KB |
Output is correct |
17 |
Correct |
10 ms |
26264 KB |
Output is correct |
18 |
Correct |
10 ms |
26204 KB |
Output is correct |
19 |
Correct |
9 ms |
26204 KB |
Output is correct |
20 |
Correct |
9 ms |
26252 KB |
Output is correct |
21 |
Correct |
9 ms |
26204 KB |
Output is correct |
22 |
Correct |
9 ms |
26204 KB |
Output is correct |
23 |
Correct |
10 ms |
26404 KB |
Output is correct |
24 |
Correct |
9 ms |
26204 KB |
Output is correct |
25 |
Correct |
9 ms |
26204 KB |
Output is correct |
26 |
Correct |
9 ms |
26204 KB |
Output is correct |
27 |
Correct |
9 ms |
26204 KB |
Output is correct |
28 |
Correct |
10 ms |
26712 KB |
Output is correct |
29 |
Correct |
11 ms |
26716 KB |
Output is correct |
30 |
Correct |
12 ms |
26716 KB |
Output is correct |
31 |
Correct |
11 ms |
26608 KB |
Output is correct |
32 |
Correct |
15 ms |
26776 KB |
Output is correct |
33 |
Correct |
14 ms |
26456 KB |
Output is correct |
34 |
Correct |
14 ms |
26460 KB |
Output is correct |
35 |
Correct |
139 ms |
56688 KB |
Output is correct |
36 |
Correct |
267 ms |
66632 KB |
Output is correct |
37 |
Correct |
141 ms |
56708 KB |
Output is correct |
38 |
Correct |
270 ms |
71504 KB |
Output is correct |
39 |
Correct |
198 ms |
57804 KB |
Output is correct |
40 |
Correct |
85 ms |
57284 KB |
Output is correct |
41 |
Correct |
494 ms |
59728 KB |
Output is correct |
42 |
Correct |
118 ms |
48396 KB |
Output is correct |
43 |
Correct |
106 ms |
39248 KB |
Output is correct |
44 |
Correct |
301 ms |
58052 KB |
Output is correct |
45 |
Correct |
406 ms |
61784 KB |
Output is correct |
46 |
Correct |
545 ms |
53684 KB |
Output is correct |
47 |
Correct |
519 ms |
53460 KB |
Output is correct |
48 |
Correct |
143 ms |
59652 KB |
Output is correct |
49 |
Correct |
260 ms |
74320 KB |
Output is correct |
50 |
Correct |
439 ms |
71772 KB |
Output is correct |
51 |
Correct |
170 ms |
62288 KB |
Output is correct |
52 |
Correct |
9 ms |
26364 KB |
Output is correct |
53 |
Correct |
590 ms |
62924 KB |
Output is correct |
54 |
Correct |
332 ms |
61196 KB |
Output is correct |
55 |
Correct |
431 ms |
64620 KB |
Output is correct |
56 |
Correct |
570 ms |
56660 KB |
Output is correct |
57 |
Correct |
672 ms |
194260 KB |
Output is correct |
58 |
Correct |
1509 ms |
268396 KB |
Output is correct |
59 |
Correct |
2317 ms |
254624 KB |
Output is correct |
60 |
Correct |
799 ms |
207884 KB |
Output is correct |
61 |
Correct |
3110 ms |
210172 KB |
Output is correct |
62 |
Correct |
1611 ms |
198632 KB |
Output is correct |
63 |
Correct |
2197 ms |
212260 KB |
Output is correct |
64 |
Correct |
3029 ms |
178632 KB |
Output is correct |
65 |
Correct |
222 ms |
69464 KB |
Output is correct |
66 |
Correct |
149 ms |
65360 KB |
Output is correct |
67 |
Correct |
169 ms |
63312 KB |
Output is correct |
68 |
Correct |
407 ms |
72784 KB |
Output is correct |
69 |
Correct |
263 ms |
59732 KB |
Output is correct |
70 |
Correct |
10 ms |
26204 KB |
Output is correct |
71 |
Correct |
551 ms |
63112 KB |
Output is correct |
72 |
Correct |
311 ms |
61020 KB |
Output is correct |
73 |
Correct |
420 ms |
61620 KB |
Output is correct |
74 |
Correct |
521 ms |
56508 KB |
Output is correct |
75 |
Correct |
1302 ms |
243060 KB |
Output is correct |
76 |
Correct |
710 ms |
223244 KB |
Output is correct |
77 |
Correct |
875 ms |
210428 KB |
Output is correct |
78 |
Correct |
2575 ms |
257388 KB |
Output is correct |
79 |
Correct |
3369 ms |
210812 KB |
Output is correct |
80 |
Correct |
1596 ms |
197680 KB |
Output is correct |
81 |
Correct |
2395 ms |
199508 KB |
Output is correct |
82 |
Correct |
3211 ms |
178580 KB |
Output is correct |
83 |
Correct |
2913 ms |
198288 KB |
Output is correct |