# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
930989 |
2024-02-21T02:57:24 Z |
thunopro |
Gap (APIO16_gap) |
C++14 |
|
33 ms |
3628 KB |
#include<bits/stdc++.h>
#include "gap.h"
using namespace std ;
#define maxn 200009
#define ll long long
#define pb push_back
#define fi first
#define se second
#define left id<<1
#define right id<<1|1
#define re exit(0);
#define _lower(x) lower_bound(v.begin(),v.end(),x)-v.begin()+1
const int mod = 1e9+7 ;
const int INF = 1e9 ;
typedef vector<int> vi ;
typedef pair<int,int> pii ;
typedef vector<pii> vii ;
template < typename T > void chkmin ( T &a , T b ) { if ( a > b ) a = b ; }
template < typename T > void chkmax ( T &a , T b ) { if ( a < b ) a = b ; }
void add ( int &a , int b )
{
a += b ;
if ( a >= mod ) a -= mod ;
if ( a < 0 ) a += mod ;
}
void rf ()
{
freopen ("bai1.inp","r",stdin) ;
}
int _pow ( int a , int n )
{
if ( n == 0 ) return 1 ;
int res = _pow (a,n/2) ;
if ( n % 2 ) return 1ll*res*res%mod*a%mod ;
else return 1ll*res*res%mod ;
}
int findGap ( int type , int n )
{
if ( type == 1 )
{
vector<ll> a (n+1) ;
ll s = 0 , t = 1e18 ;
for ( int l = 0 , r = n-1 ; l <= r ; ++ l , -- r )
{
MinMax (s,t,&a[l],&a[r]) ;
s = a [l] + 1 , t = a [r] - 1 ;
}
ll res = 0 ;
for ( int i = 1 ; i < n ; i ++ ) chkmax (res,a[i]-a[i-1]) ;
return res ;
}
}
//int main ()
//{
// ios_base::sync_with_stdio(0);
// cin.tie(0);cout.tie(0);
// rf () ;
//}
Compilation message
gap.cpp: In function 'void rf()':
gap.cpp:32:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
32 | freopen ("bai1.inp","r",stdin) ;
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
gap.cpp: In function 'int findGap(int, int)':
gap.cpp:58:1: warning: control reaches end of non-void function [-Wreturn-type]
58 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
596 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2488 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
5 |
Correct |
0 ms |
2392 KB |
Output is correct |
6 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
15 |
Correct |
1 ms |
2548 KB |
Output is correct |
16 |
Incorrect |
8 ms |
2576 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
2580 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
2588 KB |
Output isn't correct |
19 |
Incorrect |
7 ms |
2584 KB |
Output isn't correct |
20 |
Correct |
6 ms |
2576 KB |
Output is correct |
21 |
Incorrect |
27 ms |
3572 KB |
Output isn't correct |
22 |
Incorrect |
28 ms |
3624 KB |
Output isn't correct |
23 |
Incorrect |
27 ms |
3624 KB |
Output isn't correct |
24 |
Incorrect |
30 ms |
3608 KB |
Output isn't correct |
25 |
Correct |
24 ms |
3620 KB |
Output is correct |
26 |
Incorrect |
27 ms |
3620 KB |
Output isn't correct |
27 |
Incorrect |
28 ms |
3628 KB |
Output isn't correct |
28 |
Incorrect |
29 ms |
3620 KB |
Output isn't correct |
29 |
Incorrect |
33 ms |
3596 KB |
Output isn't correct |
30 |
Correct |
22 ms |
3616 KB |
Output is correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
5 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
6 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2388 KB |
Output isn't correct |
10 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
2392 KB |
Output isn't correct |
15 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
16 |
Incorrect |
7 ms |
2556 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
2580 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
2592 KB |
Output isn't correct |
19 |
Incorrect |
7 ms |
2588 KB |
Output isn't correct |
20 |
Partially correct |
8 ms |
2648 KB |
Partially correct |
21 |
Incorrect |
27 ms |
3628 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
27 ms |
3628 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
28 ms |
3616 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
27 ms |
3628 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
24 ms |
3624 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
27 ms |
3620 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
29 ms |
3628 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
33 ms |
3620 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
27 ms |
3616 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
22 ms |
3616 KB |
Expected int32, but "2500100000" found |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |