# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
47277 |
2018-04-30T05:58:57 Z |
yogahmad |
Gap (APIO16_gap) |
C++14 |
|
97 ms |
3564 KB |
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
long long findGap(int T, int N)
{
// cout<<T<<" "<<N<<endl;
long long sa,du,ti,em;
vector<long long>ve;
long long *kiri,*kanan;
kiri=&sa;
kanan=&du;
MinMax(0,1e18,kiri,kanan);
// cout<<*kiri<<' '<<*kanan<<endl;
long long gap=(*kanan-*kiri)/(N-1);
long long jaw=0;
// cout<<*kiri<<" "<<*kanan<<" "<<gap<<endl;
long long awal;
for(awal=*kiri;awal<=*kanan;awal+=gap+1){
// cout<<awal<<" <<<___\n";
long long *lo,*hi;
lo=&ti;
hi=&em;
MinMax(awal,awal+gap,lo,hi);
// cout<<awal<<' '<<awal+gap<<" -> "<<*lo<<" "<<*hi<<endl;
if(*lo==-1 && *hi==-1)
continue;
ve.push_back(*lo);
ve.push_back(*hi);
}
// cout<<awal<<endl;
sort(ve.begin(),ve.end());
// for(int i:ve)
// cout<<i<<' ';
// cout<<endl;
for(int i=1;i<ve.size();i++){
jaw=max(jaw,ve[i]-ve[i-1]);
}
// cout<<jaw<<endl;
return jaw;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:37:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1;i<ve.size();i++){
~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
428 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
428 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
480 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
532 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
540 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
596 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
16 |
Incorrect |
20 ms |
1148 KB |
Output isn't correct |
17 |
Incorrect |
21 ms |
1148 KB |
Output isn't correct |
18 |
Incorrect |
20 ms |
1148 KB |
Output isn't correct |
19 |
Incorrect |
23 ms |
1148 KB |
Output isn't correct |
20 |
Incorrect |
10 ms |
1148 KB |
Output isn't correct |
21 |
Incorrect |
77 ms |
2548 KB |
Output isn't correct |
22 |
Incorrect |
92 ms |
2548 KB |
Output isn't correct |
23 |
Incorrect |
96 ms |
2672 KB |
Output isn't correct |
24 |
Incorrect |
77 ms |
2672 KB |
Output isn't correct |
25 |
Incorrect |
73 ms |
3564 KB |
Output isn't correct |
26 |
Incorrect |
81 ms |
3564 KB |
Output isn't correct |
27 |
Incorrect |
85 ms |
3564 KB |
Output isn't correct |
28 |
Incorrect |
78 ms |
3564 KB |
Output isn't correct |
29 |
Incorrect |
81 ms |
3564 KB |
Output isn't correct |
30 |
Incorrect |
46 ms |
3564 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
3564 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
3564 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3564 KB |
Output is correct |
2 |
Correct |
2 ms |
3564 KB |
Output is correct |
3 |
Correct |
2 ms |
3564 KB |
Output is correct |
4 |
Correct |
2 ms |
3564 KB |
Output is correct |
5 |
Correct |
3 ms |
3564 KB |
Output is correct |
6 |
Correct |
2 ms |
3564 KB |
Output is correct |
7 |
Correct |
2 ms |
3564 KB |
Output is correct |
8 |
Correct |
2 ms |
3564 KB |
Output is correct |
9 |
Correct |
2 ms |
3564 KB |
Output is correct |
10 |
Correct |
2 ms |
3564 KB |
Output is correct |
11 |
Correct |
4 ms |
3564 KB |
Output is correct |
12 |
Correct |
3 ms |
3564 KB |
Output is correct |
13 |
Correct |
3 ms |
3564 KB |
Output is correct |
14 |
Correct |
3 ms |
3564 KB |
Output is correct |
15 |
Correct |
3 ms |
3564 KB |
Output is correct |
16 |
Correct |
19 ms |
3564 KB |
Output is correct |
17 |
Correct |
20 ms |
3564 KB |
Output is correct |
18 |
Correct |
25 ms |
3564 KB |
Output is correct |
19 |
Correct |
20 ms |
3564 KB |
Output is correct |
20 |
Correct |
9 ms |
3564 KB |
Output is correct |
21 |
Correct |
75 ms |
3564 KB |
Output is correct |
22 |
Correct |
74 ms |
3564 KB |
Output is correct |
23 |
Correct |
76 ms |
3564 KB |
Output is correct |
24 |
Correct |
78 ms |
3564 KB |
Output is correct |
25 |
Correct |
72 ms |
3564 KB |
Output is correct |
26 |
Correct |
78 ms |
3564 KB |
Output is correct |
27 |
Correct |
75 ms |
3564 KB |
Output is correct |
28 |
Correct |
97 ms |
3564 KB |
Output is correct |
29 |
Correct |
75 ms |
3564 KB |
Output is correct |
30 |
Correct |
44 ms |
3564 KB |
Output is correct |
31 |
Correct |
2 ms |
3564 KB |
Output is correct |
32 |
Correct |
2 ms |
3564 KB |
Output is correct |