답안 #804981

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
804981 2023-08-03T12:16:51 Z Gangsta 쌀 창고 (IOI11_ricehub) C++14
17 / 100
1000 ms 1572 KB
// a >> b = a / pow(2,b)
// a << b = a * pow(2,b)
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define sz size()
#define ss second
#define ff first
#define N 200001
#define pll pair<ll,ll>

using namespace std;

ll besthub(int r, int l, int x[N], ll b){
	ll tmp, md, ans, mx = 0;
	for(int i = 1; i <= l; i++){
		ans = 0;
		tmp = b;
		md = i;
		vector <ll> v;
		for(int i = 0; i < r; i++){
			v.pb(abs(md - x[i]));
		}
		sort(v.begin(), v.end());
		for(auto i : v){
			if(tmp <= i) break;
			ans++;
			tmp -= i;
		}
		mx = max(mx,ans);
	}
	return mx;
}

//int main(){
//	ll r, l, x[N], b;
//	cin >> r >> l;
//	for(int i = 0; i < r; i++) cin >> x[i];
//	cin >> b;
//	cout << besthub(r,l,x,b);
//}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 312 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 316 KB Output is correct
2 Correct 21 ms 212 KB Output is correct
3 Execution timed out 1086 ms 212 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1079 ms 1572 KB Time limit exceeded
2 Halted 0 ms 0 KB -