Submission #707314

# Submission time Handle Problem Language Result Execution time Memory
707314 2023-03-08T18:37:10 Z mseebacher Rice Hub (IOI11_ricehub) C++17
42 / 100
1000 ms 340 KB
//#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <functional>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

#define mp make_pair
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

const lld pi = 3.14159265358979323846;

#define MAXI (int)2e5+5


int besthub(int r,int l,int x[],ll b){
	int ans = 0;
	for(int i = 0;i<r;i++){
		for(int j = i;j<r;j++){
			ll cost = 0;
			int mid = (i+j) >> 1;
			for(int h = i;h<=j;h++){
				cost += abs(x[mid]-x[h]);
			}
			if(cost <= b) ans = max(j-i+1,ans);
		}
	}
	
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 20 ms 212 KB Output is correct
22 Correct 22 ms 308 KB Output is correct
23 Correct 18 ms 308 KB Output is correct
24 Correct 20 ms 308 KB Output is correct
25 Correct 19 ms 312 KB Output is correct
26 Correct 19 ms 308 KB Output is correct
27 Correct 21 ms 308 KB Output is correct
28 Correct 20 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 114 ms 292 KB Output is correct
4 Correct 107 ms 288 KB Output is correct
5 Correct 19 ms 308 KB Output is correct
6 Correct 20 ms 212 KB Output is correct
7 Correct 144 ms 300 KB Output is correct
8 Correct 146 ms 296 KB Output is correct
9 Correct 19 ms 316 KB Output is correct
10 Correct 20 ms 308 KB Output is correct
11 Correct 77 ms 212 KB Output is correct
12 Correct 74 ms 304 KB Output is correct
13 Correct 143 ms 300 KB Output is correct
14 Correct 140 ms 296 KB Output is correct
15 Correct 21 ms 212 KB Output is correct
16 Correct 20 ms 212 KB Output is correct
17 Correct 72 ms 304 KB Output is correct
18 Correct 72 ms 212 KB Output is correct
19 Correct 138 ms 296 KB Output is correct
20 Correct 138 ms 296 KB Output is correct
21 Execution timed out 1083 ms 340 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1071 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -