Блог пользователя flamestorm

Автор flamestorm, 23 месяца назад, По-английски

Thanks for participating!

1669A - Division?

Idea: SlavicG

Tutorial
Solution

1669B - Triple

Idea: Errichto

Tutorial
Solution

1669C - Odd/Even Increments

Idea: mesanu

Tutorial
Solution

1669D - Colorful Stamp

Idea: flamestorm

Tutorial
Solution

1669E - 2-Letter Strings

Idea: SlavicG

Tutorial
Solution

1669F - Eating Candies

Idea: MikeMirzayanov

Tutorial
Solution

1669G - Fall Down

Idea: MikeMirzayanov

Tutorial
Solution

1669H - Maximal AND

Idea: SlavicG

Tutorial
Solution
Разбор задач Codeforces Round 784 (Div. 4)
  • Проголосовать: нравится
  • +67
  • Проголосовать: не нравится

»
23 месяца назад, # |
  Проголосовать: нравится +39 Проголосовать: не нравится
»
23 месяца назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Thanks for the round, I loved it!

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

props on hosting a div 4 round

»
23 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Thanks for the awesome round and light fast editorial!

»
23 месяца назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

My first full solved round! Let's goooo!

»
23 месяца назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

Looking forward to more div.4 rounds, so I can have flawless solves like this <3.

»
23 месяца назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

Also, there are video solutions here for people who prefer those.

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I was too slow. Feels so bad knowing I could've done tons better if only I was faster. :( I'll try harder next time. Thanks for the contest guys!

»
23 месяца назад, # |
  Проголосовать: нравится +31 Проголосовать: не нравится

This may come off as an unpopular opinion but I feel the round should have at least consisted of 1 ~ 2 1600 rated greedy or ad-hoc style problems.

Lately, most CF div 2 rounds had very annoying C or B problems and it would have been nice to have a problem of those nature in this round. (Today's D was the closest to what I am trying to say)

The div 3 rounds's most difficult problems are at least of 1900 rating (non inflated) even though it is meant to be for < 1600 rated people.

I think it is as fair to have at least 1 ~ 2 1600 problems in div 4 rounds too following the div 3 standards.

Just some suggestions from my end.

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hi, can someone point out why i am getting wrong answer here for Question F. If i am running that test case on my system then i am getting the correct output but here it shows a different output. Can someone point it out why. Thanks in advance.

Code : https://codeforces.com/contest/1669/submission/154423744

  • »
    »
    23 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I think you miss the case where the amount of candies the two eat overlapped

    • »
      »
      »
      23 месяца назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      No NO, actually for this test case

      6 1127 5715 4917 682 1721 4439

      Judge is telling my output is 6, but on my system its coming 5 which is the correct answer

  • »
    »
    23 месяца назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    使用双指针试试 use double poiters, and move both while left and right have same amount,move only left when left has less,otherwise move the right import java.util.*; import java.io.*; public class Main { public static void main(String args[]) throws IOException{ BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw=new PrintWriter(System.out); Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0;i<n;i++){ int k=sc.nextInt(); int arr[]=new int[k]; for(int j=0;j<k;j++){ arr[j]=sc.nextInt(); } int ans=0; int l=0,r=k-1; int a=arr[0],b=arr[k-1]; while(l<r){; if(a==b){ ans=l+1+k-r; l++; if(l<k){ a+=arr[l]; } r--; if(r>=0){ b+=arr[r]; } } else if(a<b){ l++; if(l<k){ a+=arr[l]; } } else{ r--; if(r>=0){ b+=arr[r]; } } } System.out.println(ans); } } }

»
23 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I waste all the time debugging the split string in D. Look like I should learn some python :D

»
23 месяца назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Problems F and G were (in my opinion) the coolest ones in the round. Not surprised to realise that was Mike who proposed them.

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

in problem H why we not initialize ans=A[1]&A[2]&...A[N-1]&A[N] because why not that also contribute to final answer?? please reply

  • »
    »
    23 месяца назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    If some bit from A[1]&...&A[N] contributes to the answer, it means that every number has it, so in that case, n−count_i will be 0. In that case, that bit is catched by the answer anyways (since always k >= 0)

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Very good contest for beginners. It would be better if the H problem has a Python solution. The same solution like in tutorial gets TLE.

  • »
    »
    23 месяца назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Unfortunately, it's pretty rare to see a contest with vanilla cpython fully supported all the way up through its hardest problems.

    The main way around this has been for platforms to add pypy support (for which 64-bit has been a vast improvement), combined with substituting in faster input functions... and it's pretty workable (not without quirks/caveats though).

    For reference: 154321651 154359653

  • »
    »
    23 месяца назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
»
23 месяца назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

For some reason, my code for D didn't work even though the algo is the exact same lol Edit: small bug cost me badly :( but I had to leave the contest early

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

In problem E, why does multiset get TLE and map get AC 154413991 154415571.

»
23 месяца назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

第一次参加codeforces,打卡 first time to participate contest on codeforces

»
23 месяца назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится
»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

orz

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hi! This was my first contest. I solved three problems but did not get any rating points. Can someone explain why so?

»
23 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Me with 1300 others after solving all problems! .... Le-m-gendary Greend_mister. (><)

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

orz

»
23 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Amazing tutorial. I upsolved all the problems using this tutorial and also improve my logic in solved problems. Thanks.

»
14 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

flamestorm, if it is possible, can you tell me what is the difference between test 3 and test 45 in problem B? A reasonable Python solution takes 125ms on test 3, but more than 1s on test 45. Is there an anti-hashmap pattern, or something that I don't know of?

»
11 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

orz

»
9 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Problem H is a very good problem used a O(n*30) approach