hyforces's blog

By hyforces, history, 16 months ago, In English

This is the editorial for the recent Teamscode Summer 2023 contest, and the problems are open for upsolving on this gym. Problems were prepared by oursaco, dutin, thehunterjames, Bossologist, Esomer, danx, codicon, willy108, and hyforces. The problems were tested by omeganot, codicon, cry, skye_, Litusiano_, and Apple_Method.

A. Who is cooking?

Solution
Code

B. Restaurant Sorting

Solution
Code

C. Largest Palindromic Subsequence

Hint 1
Solution
Code

D. Yet Another Math Query Problem

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Code

E. Evil Problemsetters

Hint 1
Hint 2
Solution
Code

F. Maximum Trust

Solution
Code

G. Maximum Xor

Solution
Code

H. Permutator

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Code

I. Counting Palindromic Sequences

Hint 1
Hint 2
Solution
Code

J. TeamsCode Meetings

Hint 1
Hint 2
Hint 3
Solution
Code

K. Med and Mex

Hint 1
Hint 2
Hint 3
Solution
Code

L. Easy Tree Problem

Solution
Code

M. Gift Wrapping

Hint 1
Hint 2
Hint 3
Solution
Code

N. Save the Timeline!

Hint 1
Hint 2
Hint 3
Solution
Code

O. Average Range Query Problem

Solution
Code (codicon)

P. Omer and Intervals

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Hint 7
Hint 8
Hint 9
Hint 10
Solution
Code

Q. Beautiful Matrix Counting

Hint 1
Hint 2
Hint 3
Hint 4
Hint 1.5
Hint 1.6
Solution 1
Code
Hint 2.5
Solution 2

R. Oil Fields

Hint 1.1
Solution 1
Code 1
Hint 2.1
Hint 2.2
Solution 2
Code 2

S. Farming Negative Karma

Hint 1
Hint 2
Hint 3
Solution
Code

Happy Upsolving! As a hint towards a possible problem on the next contest:

Solution
  • Vote: I like it
  • +84
  • Vote: I do not like it

| Write comment?
»
16 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by hyforces (previous revision, new revision, compare).

»
16 months ago, # |
  Vote: I like it +19 Vote: I do not like it

posted in sub record time!

»
16 months ago, # |
  Vote: I like it +8 Vote: I do not like it

orz

»
16 months ago, # |
  Vote: I like it +1 Vote: I do not like it

orz

»
14 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Hello I think the formula in the solution of K. Med and Mex is wrong. I tried it and it didn't get right. I think this is the right formula: let size = 2*(x-1). (n-size+1) * choose(n-x-1, x-2) * size! * (n-size)!. where choose() stands for combination... correct me if I am wrong. Here is my accepted code. 229580692