?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | cry | 161 |
2 | awoo | 160 |
2 | maomao90 | 160 |
4 | atcoder_official | 157 |
5 | -is-this-fft- | 156 |
6 | nor | 155 |
7 | adamant | 153 |
8 | maroonrk | 152 |
8 | Um_nik | 152 |
10 | djm03178 | 146 |
I saw many accounts recently skipped maybe 3 or more times and solved up to E last edu? Is that real ?
Please, put submissions for potential cheaters as I didn't have time to search.
As comments point E was leaked early, I found a suspicious account start contest by E! and skipped thrice recently on EPIC, 963, 964, 965. (Already banned).
from 0 to 5. srour_ Again kafr el sheikh? are u related to Mhmd_Bakr or Al_madbwly both having previous skip records.
Also DeepanshuJindal30 and solving with 4 languages --> sabbirsajids45 creator_by_kamroncik cheater who cheated and solved E right after A lol. and the same cheaters code
It became even worse and cheaters solved D and E1 for last contest! It is a cancer spreading on codeforces.
For this problem,
Why my approach with DP and kadane's algorithm gets Wrong answer on test 2 ?
def max_subarray_sum(arr):
max_ending_here = max_so_far = arr[0]
for x in arr[1:]:
max_ending_here = max(x, max_ending_here + x)
max_so_far = max(max_so_far, max_ending_here)
return max_so_far
def max_beauty_prefix(arr):
n = len(arr)
if n == 0:
return []
# Initialize DP arrays
max_sum_no_swap = [0] * n
max_sum_with_swap = [0] * n
# Variables for tracking the sums
current_max_no_swap = 0
min_prefix_sum = 0
prefix_sum = 0
for i in range(n):
# Update prefix sum
prefix_sum += arr[i]
# Kadane's algorithm step for max subarray sum without any swap
current_max_no_swap = max(arr[i], current_max_no_swap + arr[i])
max_sum_no_swap[i] = max(max_sum_no_swap[i - 1] if i > 0 else 0, current_max_no_swap)
# Calculate max subarray sum with one swap
if i == 0:
max_sum_with_swap[i] = max_sum_no_swap[i]
else:
# Option 1: Use the no swap value
max_sum_with_swap[i] = max_sum_no_swap[i]
# Option 2: Swap the minimum prefix sum with current prefix sum
max_sum_with_swap[i] = max(max_sum_with_swap[i], prefix_sum - min_prefix_sum)
# Option 3: Swap the current element with a previous element
for j in range(i):
arr[j], arr[i] = arr[i], arr[j]
new_max_subarray_sum = max_subarray_sum(arr[:i+1])
max_sum_with_swap[i] = max(max_sum_with_swap[i], new_max_subarray_sum)
arr[j], arr[i] = arr[i], arr[j]
# Update min_prefix_sum
min_prefix_sum = min(min_prefix_sum, prefix_sum)
return max_sum_with_swap
import sys
input = sys.stdin.read
data = input().split()
n = int(data[0])
arr = list(map(int, data[1:n+1]))
# Calculate the beauty of each prefix
result = max_beauty_prefix(arr)
print(" ".join(map(str, result)))
Shame on you cheaters.
It's not funny at all to farm negative contribution by spreading hate and annoy people of certain religious beliefs.
This acc owner is so inhumane that he celebrates the genocide of 38k people in Gaza. He deletes his material occasionally.
I request admins to ban such useless account expolsion673 polluting the community.
and why mention me, lifeless ?
I see on recent actions already deleted blogs, and blog recently commented upon placed down. Even some submissions on 10th of April aren't appearing on the profiles of those who submitted it.
Some deleted blogs appearing here
Who do you learn the most from ? Clean codes, efficient and unique techniques. I'd like to hear and I'd start by jiangly and an old troll forgotten but I loved, Sparky_Master_WCH1226 if anybody know where is he, please inform us :D
Name |
---|