2095A — Piecing It Together
Credits: flamestorm
If you complete the puzzle, you will get a line of Python code reading $$$\texttt{print("puzzling")}$$$. To solve the problem, you just need to print $$$\texttt{puzzling}$$$.
#include <bits/stdc++.h>
using namespace std;
void solve() {
cout << "puzzling\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}
print("puzzling")
2095B — Plinko
Credits: AlperenT
In this problem you need to drop a ball from a column of your choosing and get it to the green area.
With simple analysis (similar to Pascal's triangle), one can notice that best chance of winning is by dropping the ball from column $$$0$$$ or $$$16$$$ where you get $$$\frac{1}{2}$$$ chance to win. This means expected number of plays to win $$$10$$$ times is $$$2^{10} = 1024$$$, which is a lot (technically though, it is $$$2^{9} = 512$$$ as the first game always wins for penalty reasons).
However, one can notice that the green area spans further than columns $$$0$$$ to $$$16$$$. This allows one to win simply by dropping the ball from any column outside that range.
If anyone got accepted by chance using columns $$$[0, 16]$$$, please write in comments.
Lastly, if you have not noticed already, this was a hint for this problem.
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
typedef long double ld;
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout << "-10000\n";
return 0;
}
2095C — Would It Be Unrated?
Credits: prvocislo
To solve this problem, you just need to do what the task asks — output the number of tests in this problem.
How do you do that? Well, if nobody has gotten accepted yet, there is not much you can do besides guess the answer through brute force.
However, you can just wait for someone else to do this tedious work for you. As soon as there is at least one accepted submission, you can use a trick:

This box on the status page will let you filter for submissions based on their failing test. If a submission got accepted, then it will show up if you query any number, as long as that number doesn't exceed the number of tests. This means that you can use this to binary search on the answer — keep cutting down the search space until you find the largest value that still shows at least one accepted submission.
Another way to get a reasonable estimate of the number of testcases are to watch as someone's accepted submission gets judged (running on test x), or to look at how many tries it took people to get accepted (assuming they start guessing from $$$1$$$, it should be around $$$140$$$).
Trivia: By writing print(143) in Python (or an equivalent in another language), you can solve both problems B and C in just $$$10$$$ characters!
Trivia 2: Some time during contest, a mysterious contestant AprilFoolsClairvoyant from the future submitted the first accepted. Such behaviour is unacceptable as time machines are prohibited by the codeforces rules, so we quickly disqualified him.
print(143)
2095D — Where Am I?
In this problem, as can be understood from the name "Where am I?", you need to find the location of the photo.
From the output style (two real numbers, first in $$$[-90, 90]$$$ and second in $$$[-180, 180]$$$), we can deduce that the problem is asking for the latitude and the longitude of the location. Given an answer, the checker returns the distance (using Haversine formula) to the actual location and accepts an answer if it is closer than 100 meters.
Easiest way to solve this problem is to just examine the photo. The first obvious thing is the "New York" sign. Do not be fooled though, the location is not in New York. A closer examination allows us to see the "Las Vegas" sign and a quick google search gives us the "New York-New York Hotel & Casino" in Las Vegas.
Knowing this and analyzing the angle of the photo we can find the exact location using street view on Google Maps (although any other map should be fine).
This gives us the coordinates $$$36.104300, -115.172835$$$, which should give accepted (however any location nearby by 100 meters is accepted as to not cause annoyance.)
Additionally, it is possible to solve this problem with different methods without even looking at the photo as the checker returns the distance. Feel free to write your ideas in the comments and we can add them here.
#include <bits/stdc++.h>
using namespace std;
int main(){
cout << "36.104300 -115.172835";
}
2095E — Pair Count
Credits: temporary1
If you click on the link to the bitwise XOR operation, you will actually be taken to a Wordle. Solving it will give you the answer $$$\texttt{MULTIPLY}$$$ (Since you can submit non-English words, and you have infinite tries (The page actually only allows 6 tries, but you can get around this by revisiting the page in incognito mode), the solution is actually relatively straightforward — you can find all the letters and where they appear by submitting strings each consisting of the same letter, then just combine all the guesses.). Thus $$$\oplus$$$ actually denotes the multiply operation.
So the solution is actually to find the number pairs of indexes $$$(i, j)$$$ for which $$$a_i^3 a_j^3 \equiv k \bmod p$$$. We can do this in $$$\mathcal{O}(n \log n + n \log p)$$$ time if we go from left to right and, for each $$$j$$$, count the number of $$$i$$$ such that $$$a_i^3 \equiv k a_j^{-3} \bmod p$$$ by keeping a map storing how frequent each $$$a_j^3$$$ was so far.
Note that there is an edge case when $$$k = 0$$$ which you should handle separately.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int a[300005];
ll power(ll x, int n, int p) {
x %= p;
ll res = 1;
while (n) {
if (n&1)res = (res*x)%p;
x = (x*x)%p;
n >>= 1;
}
return res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, p, k;
cin >> n >> p >> k;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
if (k == 0) {
cout << (*min_element(a+1,a+n+1) == 0 ? n-1 : 0) << '\n';
return 0;
}
map<int,int> mp;
ll ans = 0;
for (int i = 1; i <= n; ++i) {
if (a[i] == 0)continue;
int x = power(a[i],3,p);
int inv = power(x,p-2,p);
ans += mp[(k*(ll)inv)%p];
++mp[x];
}
cout << ans << '\n';
return 0;
}
2095F — ⅓ оf а Рrоblеm
Credits: flamestorm
$$$\frac{1}{3}$$$ of the problem is in the English statement, and the other $$$\frac{2}{3}$$$ is in the Russian statement. (This is hinted because the title of the problem in English has some Cyrillic characters, and the title of the problem in Russian has some Latin characters. These characters look identical, but if you search the text up, you'll notice the results are quite strange — because some of the characters are in a different script!)
Combining them, noting that the Russian part should go first to make sense, gives the expression $$$12a + 14ab + |a - b| + (a - 3b) b + 2$$$, which is what you should compute.
print((lambda a, b: 12*a + 14*a*b + abs(a - b) + (a - 3*b) * b + 2)(*map(int, input().split())))
2095G — Definitely a Geometry Problem
Credits: ToxicPie9
No three slimes lie on the same circle, so in fact all of them lie on the same line.
This means that you only need to sort the slimes $$$s_1, \dots, s_n$$$, and find the smallest diameter $$$d := \min_{1 \leq i \leq n-k+1} \text{dist}(s_i, s_{i+k-1})$$$. Then we just need to output $$$\pi \frac{d^2}{4}$$$.
import Data.List (sort)
dist :: [Int] -> [Int] -> Double
dist [x1, y1] [x2, y2] = hypot (fromIntegral (x1 - x2)) (fromIntegral (y1 - y2))
where hypot x y = sqrt (x * x + y * y)
solve :: Int -> [[Int]] -> Double
solve k points = min_r * min_r * pi
where
min_d = minimum $ zipWith dist points (drop (k - 1) points)
min_r = min_d / 2
main :: IO ()
main = do
[_n, k] <- (map read . words) <$> getLine
points <- (map (map read . words) . lines) <$> getContents
print $ solve k (sort points)
2095H — Blurry Vision
Credits: AlperenT
import cv2
import numpy as np
from scipy.signal import wiener
def gaussian_kernel(size, sigma):
k = cv2.getGaussianKernel(size, sigma)
kernel = np.outer(k, k)
return kernel
def wiener_deconvolution(blurred, kernel, noise_power=0.000005):
kernel /= np.sum(kernel)
img_fft = np.fft.fft2(blurred)
kernel_fft = np.fft.fft2(kernel, s=blurred.shape)
kernel_fft_conj = np.conj(kernel_fft)
denominator = kernel_fft * kernel_fft_conj + noise_power
result_fft = (img_fft * kernel_fft_conj) / denominator
result = np.fft.ifft2(result_fft).real
return np.clip(result, 0, 255).astype(np.uint8)
def deblur_image(path, kernel_size, sigma):
blurred = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
kernel = gaussian_kernel(kernel_size, sigma)
deblurred = wiener_deconvolution(blurred, kernel)
cv2.imwrite("deblurred.png", deblurred)
deblur_image("blurred.png", 25, 7)
2095I — Mysterious Script
Credits: ToxicPie9
The Balikons use base-9 numbers. This can be easily seen from the very important Figure 1 which clearly shows that the species has 9 fingers.
Now we need to know how to read the mysterious script. Except weird diagonal attachments which work as word ending markers, all characters are formed by horizontal and vertical strokes. In fact, each unique set of horizontal or vertical strokes has its own reading, and a character's reading is a defined by its horizontal and vertical components. For more information see Figure 2.
Observe that numbers are denoted by words that end with -s. We can see that characters used as digits all have a specific form: two long horizontal strokes and two long vertical strokes. Also, notice that each Balikon character resembles a 3x3 grid. Combining these and the base-9 fact, we can see that each digit character creates a square on the grid. From all digits in the example (1, 2, 3, 5, 6, 7) we can see that the numbers are ordered from top to bottom from left to right.

Figure 2: Balikon script
Now we know all digits in the Balikon script and how to read them.
mod balikon {
#[derive(Debug)]
pub struct BalikonNum(pub u64);
#[derive(Debug)]
pub struct ParseBalikonError;
impl BalikonNum {
const BASE: u64 = 9;
const DIGITS: [&str; Self::BASE as usize] =
["la", "le", "lon", "sha", "she", "shon", "ta", "te", "ton"];
fn parse_inner(s: &str) -> Option<u64> {
if s.is_empty() {
return Some(0);
}
(0..Self::BASE)
.filter_map(|i| {
Self::parse_inner(s.strip_suffix(Self::DIGITS[i as usize])?)
.map(|x| x * Self::BASE + i)
})
.next()
}
}
impl<T> From<T> for BalikonNum
where
u64: From<T>,
{
fn from(value: T) -> Self {
Self(value.into())
}
}
impl std::str::FromStr for BalikonNum {
type Err = ParseBalikonError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
s.strip_suffix("s")
.and_then(Self::parse_inner)
.map(BalikonNum)
.ok_or(ParseBalikonError)
}
}
impl std::fmt::Display for BalikonNum {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut n = self.0;
let mut digits = vec![];
while n > 0 {
digits.push(n % Self::BASE);
n /= Self::BASE;
}
if digits.is_empty() {
digits.push(0);
}
for i in digits.into_iter().rev() {
write!(f, "{}", Self::DIGITS[i as usize])?;
}
write!(f, "s")
}
}
impl std::ops::Add for BalikonNum {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
BalikonNum(self.0 + rhs.0)
}
}
}
use balikon::BalikonNum;
fn main() {
let mut input = String::new();
std::io::stdin().read_line(&mut input).expect("what");
let (a, b) = input.trim().split_once(' ').expect("parse error");
let a: BalikonNum = a.parse().expect("parse error");
let b: BalikonNum = b.parse().expect("parse error");
println!("{}", a + b);
}
2095J — Premiere at a Wrong Time
Look at the problem name. What can be premiered at a wrong time?
Yes, the video editorial. Where can you usually find an editorial?
Yes, the blog. In the last paragraphs of the blog, there's a link to the editorial. Click it and watch it carefully.
Is there anything unusual with this editorial?
You're right! Who puts musics while recording a video editorial? Also, Kent mentioned that "the songs we're using as the background music are in our favorite playlist; we enjoy them a lot, and you should definitely check them out!" Figure out what the songs are!
There's still something accessible. Can you find it?
Brilliant idea to steal the solution from the slide! The link is clearly visible in the video. You can manually copy the URL and read it at your end.
In Step 4, you can use Shazam, Google's hum-a-song search, or any other music identification tools, and find that the musics (in playing order) are:
- What's The Problem? (by OSKI)
- 23 (by Diamond Eyes)
- Time (by OVSKY)
- 51 (by THYKIER)
- A&B (by MADZI & ETikka)
- On (by Alisky)
- Code (by MANSHN)
- Forces (by Jim Yosef)
Combining all these words, you'll get "what's the problem 23 time 51 A&B on code forces". As $$$23 \times 51 = 1173$$$, this is asking what 1173A and 1173B are on Codeforces.
If you read the slide, you can find the input and output format of this problem. The input can be either first or second. Therefore, if the input is first, output Nauuo and Votes; otherwise, output Nauuo and Chess.








