# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
922105 |
2024-02-05T05:26:46 Z |
tamir1 |
Rice Hub (IOI11_ricehub) |
C++14 |
|
9 ms |
1884 KB |
#include "ricehub.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll ans,cur,i,sz,med,fi;
int besthub(int R, int L, int X[], long long B)
{
fi=-1;
sz=1;
for(i=1;i<R;i++){
sz++;
if(sz%2==1){
cur+=(X[i]-X[med]);
}
else{
cur+=(X[med+1]-X[med]);
med++;
cur+=(X[i]-X[med]);
}
while(cur>B){
sz--;
fi++;
if(sz%2==1){
cur-=(X[med]-X[fi]);
}
else{
cur+=(X[med+1]-X[med]);
med++;
cur-=(X[med]-X[fi]);
}
}
ans=max(ans,sz);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
9 ms |
1884 KB |
Output is correct |
4 |
Correct |
9 ms |
1884 KB |
Output is correct |
5 |
Correct |
4 ms |
860 KB |
Output is correct |
6 |
Correct |
4 ms |
824 KB |
Output is correct |
7 |
Correct |
8 ms |
1372 KB |
Output is correct |
8 |
Correct |
8 ms |
1372 KB |
Output is correct |
9 |
Correct |
4 ms |
920 KB |
Output is correct |
10 |
Correct |
4 ms |
860 KB |
Output is correct |
11 |
Correct |
9 ms |
1884 KB |
Output is correct |
12 |
Correct |
9 ms |
1884 KB |
Output is correct |
13 |
Correct |
4 ms |
980 KB |
Output is correct |
14 |
Correct |
4 ms |
984 KB |
Output is correct |
15 |
Correct |
7 ms |
1372 KB |
Output is correct |
16 |
Correct |
7 ms |
1368 KB |
Output is correct |
17 |
Correct |
8 ms |
1872 KB |
Output is correct |
18 |
Correct |
9 ms |
1836 KB |
Output is correct |
19 |
Correct |
9 ms |
1628 KB |
Output is correct |
20 |
Correct |
9 ms |
1628 KB |
Output is correct |