Submission #295872

# Submission time Handle Problem Language Result Execution time Memory
295872 2020-09-10T05:06:18 Z dCoding Gap (APIO16_gap) C++14
0 / 100
49 ms 2216 KB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define ll long long 

ll findGap(int t, int n) {
	ll lo = 0, hi = 1e18;
	vector<ll> l,h;
	ll mn = 0,mx = 0;
	while(l.size()+h.size() < n) {
		MinMax(lo,hi,&mn,&mx);
		if(mn == mx) {
			l.push_back(mn);
		} else {
			l.push_back(mn);
			h.push_back(mx);
		}
		lo = mn;
		hi = mx;
	}
	ll ans = 0;
	for(int i=1;i<l.size();i++) ans = max(ans, l[i]-l[i-1]);
	for(int i=1;i<h.size();i++) ans = max(ans, h[i]-h[i-1]);
	ans = max(ans, h[0]-l.back());
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:10:26: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |  while(l.size()+h.size() < n) {
      |        ~~~~~~~~~~~~~~~~~~^~~
gap.cpp:22:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i=1;i<l.size();i++) ans = max(ans, l[i]-l[i-1]);
      |              ~^~~~~~~~~
gap.cpp:23:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for(int i=1;i<h.size();i++) ans = max(ans, h[i]-h[i-1]);
      |              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 0 ms 512 KB Output isn't correct
4 Incorrect 0 ms 384 KB Output isn't correct
5 Incorrect 0 ms 384 KB Output isn't correct
6 Incorrect 0 ms 384 KB Output isn't correct
7 Incorrect 0 ms 384 KB Output isn't correct
8 Incorrect 0 ms 384 KB Output isn't correct
9 Incorrect 0 ms 384 KB Output isn't correct
10 Incorrect 1 ms 384 KB Output isn't correct
11 Incorrect 1 ms 384 KB Output isn't correct
12 Incorrect 1 ms 384 KB Output isn't correct
13 Incorrect 1 ms 384 KB Output isn't correct
14 Incorrect 1 ms 384 KB Output isn't correct
15 Incorrect 1 ms 384 KB Output isn't correct
16 Incorrect 11 ms 768 KB Output isn't correct
17 Incorrect 10 ms 896 KB Output isn't correct
18 Incorrect 10 ms 896 KB Output isn't correct
19 Incorrect 10 ms 896 KB Output isn't correct
20 Incorrect 6 ms 896 KB Output isn't correct
21 Incorrect 41 ms 2084 KB Output isn't correct
22 Incorrect 42 ms 2080 KB Output isn't correct
23 Incorrect 44 ms 2076 KB Output isn't correct
24 Incorrect 42 ms 2080 KB Output isn't correct
25 Incorrect 33 ms 2084 KB Output isn't correct
26 Incorrect 42 ms 2080 KB Output isn't correct
27 Incorrect 41 ms 2084 KB Output isn't correct
28 Incorrect 41 ms 2076 KB Output isn't correct
29 Incorrect 44 ms 2012 KB Output isn't correct
30 Incorrect 26 ms 2084 KB Output isn't correct
31 Incorrect 1 ms 384 KB Output isn't correct
32 Incorrect 0 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 0 ms 384 KB Output isn't correct
6 Incorrect 0 ms 384 KB Output isn't correct
7 Incorrect 0 ms 384 KB Output isn't correct
8 Incorrect 0 ms 384 KB Output isn't correct
9 Incorrect 0 ms 384 KB Output isn't correct
10 Incorrect 0 ms 384 KB Output isn't correct
11 Incorrect 1 ms 384 KB Output isn't correct
12 Incorrect 1 ms 384 KB Output isn't correct
13 Incorrect 1 ms 384 KB Output isn't correct
14 Incorrect 1 ms 384 KB Output isn't correct
15 Incorrect 1 ms 384 KB Output isn't correct
16 Incorrect 10 ms 844 KB Output isn't correct
17 Incorrect 10 ms 896 KB Output isn't correct
18 Incorrect 10 ms 896 KB Output isn't correct
19 Incorrect 10 ms 896 KB Output isn't correct
20 Incorrect 7 ms 896 KB Output isn't correct
21 Incorrect 40 ms 2076 KB Expected int32, but "5000050000" found
22 Incorrect 40 ms 2080 KB Expected int32, but "5000050000" found
23 Incorrect 41 ms 2084 KB Expected int32, but "5000050000" found
24 Incorrect 41 ms 2044 KB Expected int32, but "5000050000" found
25 Incorrect 38 ms 2084 KB Expected int32, but "5000050000" found
26 Incorrect 42 ms 2084 KB Expected int32, but "5000050000" found
27 Incorrect 42 ms 2080 KB Expected int32, but "5000050000" found
28 Incorrect 49 ms 2076 KB Expected int32, but "5000050000" found
29 Incorrect 40 ms 2084 KB Expected int32, but "5000050000" found
30 Incorrect 25 ms 2216 KB Expected int32, but "5000050000" found
31 Incorrect 0 ms 384 KB Output isn't correct
32 Incorrect 0 ms 384 KB Output isn't correct