#include "jelly.h"
#include <bits/stdc++.h>
using namespace std;
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {
int N = a.size();
valarray<int> sides(0, N);
int X = x;
int Y = y;
for (int i = 0; i < N; i++) {
if(a[i] <= X) {
sides[i] = 1;
X -= a[i];
}else if(b[i] <= Y) {
sides[i] = 2;
Y -= b[i];
}
if(sides[i] != 0) continue;
for(int j = 0; j < i; j++) {
if(sides[j] == 1) {
if(a[i] <= X + a[j] and b[j] <= Y) {
X += a[j] - a[i];
Y -= b[j];
sides[j] = 2;
sides[i] = 1;
break;
}
}else if(sides[j] == 2) {
if(b[i] <= Y + b[j] and a[j] <= X) {
Y += b[j] - b[i];
X -= a[j];
sides[j] = 1;
sides[i] = 2;
break;
}
}
}
}
int ans = 0;
for (int i = 0; i < N; i++) {
ans += sides[i] != 0;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
8 ms |
332 KB |
1st lines differ - on the 1st token, expected: '689', found: '648' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
308 KB |
1st lines differ - on the 1st token, expected: '62', found: '8' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
332 KB |
1st lines differ - on the 1st token, expected: '154', found: '18' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
2 |
Halted |
0 ms |
0 KB |
- |