question stringlengths 56 2.17k | seed_question stringlengths 29 13k | seed_source stringclasses 11
values | response stringlengths 1.05k 171k | code stringlengths 19 10.6k |
|---|---|---|---|---|
Perpustakaan menyediakan bahan bacaan untuk *n* buku klub. Setiap buku klub membutuhkan sejumlah halaman yang akan dicetak. Perpustakaan memiliki *x* lembar kertas berlapis dua sisi dan *y* lembar kertas berlapis satu sisi. Sebuah lembar berlapis dua sisi dapat mencetak dua halaman, sementara lembar berlapis satu sisi ... | На тренировку по подготовке к соревнованиям по программированию пришли *n* команд. Тренер для каждой команды подобрал тренировку, комплект задач для *i*-й команды занимает *a**i* страниц. В распоряжении тренера есть *x* листов бумаги, у которых обе стороны чистые, и *y* листов, у которых только одна сторона чистая. При... | codeforces | Okay, so I've got this programming problem to solve. Let me try to understand it.
The problem is about a library that needs to print materials for different book clubs. Each book club requires a certain number of pages. The library has two types of paper: double-sided and single-sided. Each double-sided sheet can prin... | n, x, y = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
count = 0
for pages in p:
required_x = (pages + 1) // 2
if x >= required_x:
x -= required_x
count += 1
else:
if y >= pages:
y -= pages
count += 1
print(count) |
**Matriks ukuran `m x m` disebut simetris jika tetap sama saat baris dibalikkan. Anda diberi bilangan bulat `m^2`. Tugas Anda adalah mengatur bilangan bulat `m^2` ini menjadi matriks sehingga setiap bilangan bulat digunakan persis sekali, dan matriks yang dihasilkan simetris. **Jika ada beberapa solusi yang mungkin, ce... | Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed.
For example, the following matrices are palindromic:
<image>
The following matrices are not palindromic because they change... | codeforces | Okay, I need to solve this problem where I have to determine if a given set of m^2 integers can be arranged into an m x m symmetrical matrix. If possible, I have to output such a matrix, otherwise print "NO".
First, let me understand the problem statement clearly. A symmetrical matrix here is one that remains the sam... | def main():
import sys
input = sys.stdin.read().split()
m = int(input[0])
elements = list(map(int, input[1:]))
elements.sort()
# Check frequency condition
freq = {}
for num in elements:
if num in freq:
freq[num] += 1
else:
freq[num] = 1
is_ev... |
Perincian: Seorang tukang roti memiliki beberapa baking cookie, masing-masing dengan jumlah cookie tertentu. Setiap menit, ia dapat memilih dua baking yang berdekatan dan mentransfer satu cookie dari baking yang memiliki lebih banyak cookie ke baking yang memiliki lebih sedikit cookie. Tujuannya adalah untuk membuat se... | The grass has dried up in Farmer John's pasture due to a drought. After hours of
despair and contemplation, Farmer John comes up with the brilliant idea of
purchasing corn to feed his precious cows.
FJ’s $N$ cows ($1 \leq N \leq 10^5$) are arranged in a line such that the
$i$th cow in line has a hunger level of $h_i$ ... | usaco | Okay, so I've got this programming problem to solve, and I'm a bit stuck but trying to figure it out. Let's see what the problem is about.
The problem says that a baker has several trays with cookies. Each minute, he can pick two adjacent trays and transfer one cookie from the one with more to the one with less, but o... | def main():
import sys
input = sys.stdin.read().split()
ptr = 0
T = int(input[ptr])
ptr += 1
for _ in range(T):
N = int(input[ptr])
ptr += 1
c = list(map(int, input[ptr:ptr+N]))
ptr += N
S = sum(c)
if S % N != 0:
print(-1)
c... |
"Mengingat jumlah segmen yang berhenti bekerja secara total dan keadaan angka saat ini, tentukan jum(...TRUNCATED) | "Denis, after buying flowers and sweets (you will learn about this story in the next task), went to (...TRUNCATED) | codeforces | "Okay, I need to solve this problem. Let's read it carefully again.\n\nThe problem is about a seven-(...TRUNCATED) | "import sys\n\ndef main():\n n, k = map(int, sys.stdin.readline().split())\n digits = [sys.std(...TRUNCATED) |
"Desain jalan yang berbeda memiliki dua sistem pemantauan lalu lintas yang berbeda yang menggunakan (...TRUNCATED) | "Problem 2: Dueling GPS's [Brian Dean, 2014]\n\nFarmer John has recently purchased a new car online,(...TRUNCATED) | usaco | "Okay, I've got this programming problem to solve. Let's read through it carefully.\n\nSo, the probl(...TRUNCATED) | "import heapq\n\ndef dijkstra(graph, start, num_nodes):\n dist = [float('inf')] * (num_nodes + 1)(...TRUNCATED) |
"Perencanaan kota: Menghitung biaya total minimum yang diperlukan untuk menghubungkan semua lingkung(...TRUNCATED) | "Problem 1: Watering the Fields [Brian Dean, 2014]\n\nDue to a lack of rain, Farmer John wants to bu(...TRUNCATED) | usaco | "Alright, I've got this programming problem to solve, and I'm a bit nervous because I'm still new to(...TRUNCATED) | "class DSU:\n def __init__(self, size):\n self.parent = list(range(size))\n self.ra(...TRUNCATED) |
"Deskripsi Masalah**: Seorang pengirim barang perlu mengirimkan paket ke sebuah bangunan. Bangunan i(...TRUNCATED) | "Chef has a new customer and he wants to prepare his order as soon as possible. While preparing, he (...TRUNCATED) | codechef | "Alright, I've got this programming problem to solve. Let's try to figure out what needs to be done (...TRUNCATED) | "import sys\n\ndef main():\n input = sys.stdin.read\n data = input().split()\n T = int(data(...TRUNCATED) |
"Penentuan nilai-nilai mungkin dari `y` ** sehingga hasil dari `y` dan jumlah digitnya sama dengan `(...TRUNCATED) | "Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash th(...TRUNCATED) | codeforces | "<think>\nAlright, I need to solve this problem where given a number m, I have to find all possible (...TRUNCATED) | "m = int(input())\nsolutions = set()\n\nfor s in range(1, 82): # since sum of digits can't exceed 8(...TRUNCATED) |
"Untuk menemukan harta karun yang tersembunyi, para petualang perlu memecahkan teka-teki untuk memut(...TRUNCATED) | "Note : This question carries $150$ $points$\nThere is an outcry in Middle Earth, as the greatest wa(...TRUNCATED) | codechef | "Okay, let's tackle this problem. Hmm, the problem says we need to find the number of pairs (a, b) s(...TRUNCATED) | "def count_valid_bs(L):\n count = 0\n d = 1\n while True:\n b = 10**d -1\n if(...TRUNCATED) |
"**Jawa ini dibagi menjadi periode pagi dan malam untuk masing-masing lima hari kerja. **Jawa ini ha(...TRUNCATED) | "Joisino is planning to open a shop in a shopping street.\n\nEach of the five weekdays is divided in(...TRUNCATED) | atcoder | "Okay, I'm trying to solve this programming problem. Let me read through the problem statement caref(...TRUNCATED) | "n = int(input())\nstores_masks = []\nfor _ in range(n):\n bits = list(map(int, input().split()))(...TRUNCATED) |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 8