# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
930988 |
2024-02-21T02:57:02 Z |
thunopro |
Gap (APIO16_gap) |
C++14 |
|
36 ms |
5668 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]) ;
cout << res << "\n" ;
}
}
//int main ()
//{
// ios_base::sync_with_stdio(0);
// cin.tie(0);cout.tie(0);
// rf () ;
//}
Compilation message
gap.cpp: In function 'int findGap(int, int)':
gap.cpp:58:1: warning: no return statement in function returning non-void [-Wreturn-type]
58 | }
| ^
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) ;
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 6 |
2 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
3 |
Runtime error |
5 ms |
4696 KB |
Execution killed with signal 6 |
4 |
Runtime error |
3 ms |
4624 KB |
Execution killed with signal 6 |
5 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
6 |
Runtime error |
4 ms |
4648 KB |
Execution killed with signal 6 |
7 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
8 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
9 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
10 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
11 |
Runtime error |
4 ms |
4692 KB |
Execution killed with signal 6 |
12 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
13 |
Runtime error |
5 ms |
4696 KB |
Execution killed with signal 6 |
14 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
15 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
16 |
Runtime error |
10 ms |
4948 KB |
Execution killed with signal 6 |
17 |
Runtime error |
10 ms |
4952 KB |
Execution killed with signal 6 |
18 |
Runtime error |
10 ms |
5116 KB |
Execution killed with signal 6 |
19 |
Runtime error |
10 ms |
4940 KB |
Execution killed with signal 6 |
20 |
Runtime error |
9 ms |
4940 KB |
Execution killed with signal 6 |
21 |
Runtime error |
32 ms |
5380 KB |
Execution killed with signal 6 |
22 |
Runtime error |
30 ms |
5388 KB |
Execution killed with signal 6 |
23 |
Runtime error |
35 ms |
5380 KB |
Execution killed with signal 6 |
24 |
Runtime error |
33 ms |
5392 KB |
Execution killed with signal 6 |
25 |
Runtime error |
30 ms |
5640 KB |
Execution killed with signal 6 |
26 |
Runtime error |
31 ms |
5668 KB |
Execution killed with signal 6 |
27 |
Runtime error |
31 ms |
5392 KB |
Execution killed with signal 6 |
28 |
Runtime error |
31 ms |
5392 KB |
Execution killed with signal 6 |
29 |
Runtime error |
30 ms |
5388 KB |
Execution killed with signal 6 |
30 |
Runtime error |
25 ms |
5656 KB |
Execution killed with signal 6 |
31 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
32 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
2 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
3 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
4 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
5 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
6 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
7 |
Runtime error |
3 ms |
4692 KB |
Execution killed with signal 6 |
8 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
9 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
10 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
11 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
12 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
13 |
Runtime error |
4 ms |
4948 KB |
Execution killed with signal 6 |
14 |
Runtime error |
5 ms |
4696 KB |
Execution killed with signal 6 |
15 |
Runtime error |
4 ms |
4960 KB |
Execution killed with signal 6 |
16 |
Runtime error |
10 ms |
5076 KB |
Execution killed with signal 6 |
17 |
Runtime error |
10 ms |
4948 KB |
Execution killed with signal 6 |
18 |
Runtime error |
10 ms |
4956 KB |
Execution killed with signal 6 |
19 |
Runtime error |
10 ms |
4956 KB |
Execution killed with signal 6 |
20 |
Runtime error |
9 ms |
4936 KB |
Execution killed with signal 6 |
21 |
Runtime error |
31 ms |
5440 KB |
Execution killed with signal 6 |
22 |
Runtime error |
31 ms |
5400 KB |
Execution killed with signal 6 |
23 |
Runtime error |
36 ms |
5628 KB |
Execution killed with signal 6 |
24 |
Runtime error |
35 ms |
5508 KB |
Execution killed with signal 6 |
25 |
Runtime error |
29 ms |
5432 KB |
Execution killed with signal 6 |
26 |
Runtime error |
31 ms |
5400 KB |
Execution killed with signal 6 |
27 |
Runtime error |
30 ms |
5436 KB |
Execution killed with signal 6 |
28 |
Runtime error |
35 ms |
5432 KB |
Execution killed with signal 6 |
29 |
Runtime error |
31 ms |
5444 KB |
Execution killed with signal 6 |
30 |
Runtime error |
26 ms |
5396 KB |
Execution killed with signal 6 |
31 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 6 |
32 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |