답안 #805290

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
805290 2023-08-03T14:52:00 Z Halym2007 쌀 창고 (IOI11_ricehub) C++11
0 / 100
1000 ms 1236 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
map <int, int> m;
int besthub(int R, int L, int X[], ll B) {
	for (int i = 0; i < R; ++i) {
		m[X[i]] = 1;
	}
	int jog = 0, op, ans;
	for (int i = 0; i <= L; ++i) {
		op = ans = 0;
		for (int j = i; j <= L; ++j) {
			op++;
			if (op > B) break;
			if (m.find (j) != m.end ()) {
				ans++;	
			}	
		}
		jog = max (jog, ans);
	}
	return jog;
}
//int main() {
//	 freopen("kk.txt", "r", stdin);
//	int R, L;
//	ll B;
//	cin >> R >> L >> B;
//	int X[R];
//	for (int i = 0; i < R; ++i) {
//		cin >> X[i];
//	}
//	cout << besthub (R, L, X, B);
//}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 335 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1070 ms 1236 KB Time limit exceeded
2 Halted 0 ms 0 KB -