# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
104975 |
2019-04-10T03:35:18 Z |
puyu_liao |
Gap (APIO16_gap) |
C++14 |
|
85 ms |
4388 KB |
#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
#define IOS {cin.tie(0);ios_base::sync_with_stdio(false);}
#define N 300006
//
//vector<int> v;
//void MinMax(long long s, long long t, long long* mn, long long* mx){
// cout << "ASKed " << s << ' ' << t << '\n';
// auto imn = lower_bound(v.begin(),v.end(),s);
// auto imx = upper_bound(v.begin(),v.end(),t);
// if(imn == v.end() || imx == v.begin() || *imn > *--imx) {
// cout << "return (-1,-1)" << '\n';
// return *mn = *mx = -1ll, void();
// }
// *mn = *imn;
// *mx = *imx;
// cout << "return " << complex<int>(*mn,*mx) << '\n';
//}
#include "gap.h"
typedef long long ll;
ll findGap(int T,int n){
if(T==1){
vector<ll> v1,v2;
ll ans = 0;
ll s = 0, t = 1000000000000000000ll,mn,mx;
for(int i=1,j=n;i<=j;i++,j--){
MinMax(s,t,&mn,&mx);
v1.push_back(mn);
if(i != j) v2.push_back(mx);
s = mn+1; t=mx-1;
}
reverse(v2.begin(),v2.end());
for(ll i : v2) v1.push_back(i);
for(ll i : v1) cout << i << ' '; cout << '\n';
for(int i=0;i<v1.size()-1;i++) ans = max(ans,v1[i+1]-v1[i]);
return ans;
}
else{
ll ans = 0;
ll s = 0, t = 0,mn,mx,last;
MinMax(s,t,&mn,&mx);
last = mn; s = t = mn+1;
for(int i=1;i<n;i++){
MinMax(s,t,&mn,&mx);
ans = max(ans,mn-last);
last = mn;
s = t = mn+1;
}
return ans;
}
}
Compilation message
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:36:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(ll i : v1) cout << i << ' '; cout << '\n';
^~~
gap.cpp:36:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(ll i : v1) cout << i << ' '; cout << '\n';
^~~~
gap.cpp:37:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<v1.size()-1;i++) ans = max(ans,v1[i+1]-v1[i]);
~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Expected EOLN |
2 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
3 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
4 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
5 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
6 |
Incorrect |
3 ms |
384 KB |
Expected EOLN |
7 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
8 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
9 |
Incorrect |
3 ms |
256 KB |
Expected EOLN |
10 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
11 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
12 |
Incorrect |
3 ms |
384 KB |
Expected EOLN |
13 |
Incorrect |
4 ms |
384 KB |
Expected EOLN |
14 |
Incorrect |
3 ms |
384 KB |
Expected EOLN |
15 |
Incorrect |
3 ms |
384 KB |
Expected EOLN |
16 |
Incorrect |
16 ms |
1452 KB |
Expected EOLN |
17 |
Incorrect |
19 ms |
1452 KB |
Expected EOLN |
18 |
Incorrect |
18 ms |
1452 KB |
Expected EOLN |
19 |
Incorrect |
22 ms |
1468 KB |
Expected EOLN |
20 |
Incorrect |
13 ms |
1196 KB |
Expected EOLN |
21 |
Incorrect |
63 ms |
4316 KB |
Expected EOLN |
22 |
Incorrect |
85 ms |
4388 KB |
Expected EOLN |
23 |
Incorrect |
61 ms |
4248 KB |
Expected EOLN |
24 |
Incorrect |
70 ms |
4248 KB |
Expected EOLN |
25 |
Incorrect |
64 ms |
3676 KB |
Expected EOLN |
26 |
Incorrect |
68 ms |
4248 KB |
Expected EOLN |
27 |
Incorrect |
66 ms |
4252 KB |
Expected EOLN |
28 |
Incorrect |
81 ms |
4248 KB |
Expected EOLN |
29 |
Incorrect |
67 ms |
4316 KB |
Expected EOLN |
30 |
Incorrect |
54 ms |
3096 KB |
Expected EOLN |
31 |
Incorrect |
2 ms |
384 KB |
Expected EOLN |
32 |
Incorrect |
3 ms |
384 KB |
Expected EOLN |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
6 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
12 |
Incorrect |
4 ms |
384 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
16 |
Incorrect |
13 ms |
512 KB |
Output isn't correct |
17 |
Incorrect |
12 ms |
512 KB |
Output isn't correct |
18 |
Incorrect |
12 ms |
484 KB |
Output isn't correct |
19 |
Incorrect |
13 ms |
512 KB |
Output isn't correct |
20 |
Incorrect |
8 ms |
512 KB |
Output isn't correct |
21 |
Incorrect |
42 ms |
1144 KB |
Output isn't correct |
22 |
Incorrect |
44 ms |
1152 KB |
Output isn't correct |
23 |
Incorrect |
45 ms |
1144 KB |
Output isn't correct |
24 |
Incorrect |
54 ms |
1152 KB |
Output isn't correct |
25 |
Incorrect |
39 ms |
1152 KB |
Output isn't correct |
26 |
Incorrect |
54 ms |
1272 KB |
Output isn't correct |
27 |
Incorrect |
43 ms |
1152 KB |
Output isn't correct |
28 |
Incorrect |
45 ms |
1144 KB |
Output isn't correct |
29 |
Incorrect |
43 ms |
1144 KB |
Output isn't correct |
30 |
Incorrect |
32 ms |
1272 KB |
Output isn't correct |
31 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |