2021-06-16 · 2분
BOJ 7569 — Tomato
A short write-up for BOJ 7569 (Tomato), a 3D BFS problem.
algorithmboj
2021-06-20 · 1분
This post is over 2 years old. The content may be outdated.
https://www.acmicpc.net/problem/11047 <- the problem
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int N, K;
int cnt = 0;
cin >> N >> K;
int values[10];
for(int i = 0; i < N; i++)
{
cin >> values[i];
}
for(int i = N - 1; i >= 0; i--)
{
while(K >= values[i])
{
K -= values[i];
cnt++;
}
}
cout << cnt << "\n";
return 0;
}
Original (Korean): tistory — published 2021-06-20, migrated to this blog. This translation was generated with the help of AI.
…