Actually do the problem
I completely forgot to commit this one...
This commit is contained in:
parent
92daea9371
commit
e6bcb6f654
@ -87,7 +87,7 @@ int main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
vi cards;
|
vi cards;
|
||||||
ll total = 0;
|
int total = 0;
|
||||||
|
|
||||||
while (n--) {
|
while (n--) {
|
||||||
string a;
|
string a;
|
||||||
@ -96,23 +96,10 @@ int main()
|
|||||||
total += cards.back();
|
total += cards.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t i = 0;
|
int cmax = max(cards[0], total / p);
|
||||||
size_t j = 0;
|
|
||||||
int cmax = 0;
|
|
||||||
int now = 0;
|
|
||||||
while (j < cards.size()) {
|
|
||||||
if (total - now < now) {
|
|
||||||
now -= cards[i];
|
|
||||||
i++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
now += cards[j];
|
|
||||||
j++;
|
|
||||||
rmax(cmax, now);
|
|
||||||
}
|
|
||||||
|
|
||||||
int amax = 0;
|
int amax = 0;
|
||||||
now = 0;
|
int now = 0;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (auto i : cards) {
|
for (auto i : cards) {
|
||||||
if (now + i > cmax) {
|
if (now + i > cmax) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user