Codeforces Round 966 (Div. 3) Solutions
A. Primary Task
Approach
The string is invalid in the following cases:
Length ≤ 2.
Does not start with "10".
The substring after "10" converts to an integer less than 2, or has leading zeros.
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
string s;
cin >> s;
if ...
Posted on Tue, 12 May 2026 16:38:35 +0000 by Janjan
Preliminary solutions for AtCoder Beginner Contest 064
Problem A: Check multiples of 4
Given three digits a, b, c (most significant first), form the three-digit number n = 100*a + 10*b + c. Determine whether n is divisible by 4.
int a, b, c; cin >> a >> b >> c;
int n = a * 100 + b * 10 + c;
cout << (n % 4 == 0 ? "YES" : "NO") << "\n";
Pro ...
Posted on Mon, 11 May 2026 07:02:20 +0000 by lostsoul111455
LeetCode Daily Challenge: Convert to 2D Array
Given an integer array nums, construct a 2D array that satisfies the following conditions:
The 2D array should contain only elements from the array nums.
Each row of the 2D array must consist of distinct itnegers.
The number of rows should be minimized.
Return any valid result. If multiple solutions exist, any one is acceptable.
Note: Rows in ...
Posted on Sun, 10 May 2026 15:14:55 +0000 by songwind
Minimum Days to Create m Bouquets Using Binary Search
Problem Overview
Given an array bloomDay where bloomDay[i] represents the day on which the i-th flower blooms, determine the minimum number of days required to make m bouquets. Each bouquet requires exactly k adjacent flowers that have already bloomed.
If it's impossible to create m bouquets (insufficient flowers), return -1.
Constraints
1 < ...
Posted on Sat, 09 May 2026 21:41:34 +0000 by dujed