From b737eca173f623557dd5a7c2611749d351ad1822 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Fri, 10 Jul 2026 13:41:41 +0900 Subject: [PATCH] complete jungol//2194.cpp and fix it --- storage/jungol/cpp/completed/2194.cpp | 43 +++++++++++++++++++++ storage/jungol/cpp/{ => completed}/3521.cpp | 0 storage/jungol/cpp/{ => completed}/4520.cpp | 0 3 files changed, 43 insertions(+) create mode 100644 storage/jungol/cpp/completed/2194.cpp rename storage/jungol/cpp/{ => completed}/3521.cpp (100%) rename storage/jungol/cpp/{ => completed}/4520.cpp (100%) diff --git a/storage/jungol/cpp/completed/2194.cpp b/storage/jungol/cpp/completed/2194.cpp new file mode 100644 index 0000000..10af56c --- /dev/null +++ b/storage/jungol/cpp/completed/2194.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#define let auto +#define fn auto +#define usize size_t +using namespace std; + +#define LIMIT (((usize) 1 << 63) - 1); + +fn fastio() { + ios::sync_with_stdio(false); + cin.tie(nullptr); +} + +fn main() -> int { + fastio(); + usize n, s; + cin >> n >> s; + let costs = vector(n); + let yopps = vector(n); + // it needs cost S for storing 1 litre of milk for a week. + let cummin = vector(n); + + for (usize i = 0; i < n; i++) { + cin >> costs[i] >> yopps[i]; + } + + let curr_min = (usize) LIMIT; + + for (usize i = 0; i < n; i++) { + curr_min = min(curr_min + s, costs[i]); + cummin[i] = curr_min; + } + + let total = (usize) 0; + for (usize i = 0; i < n; i++) { + total += cummin[i] * yopps[i]; + } + + cout << total << endl; +} \ No newline at end of file diff --git a/storage/jungol/cpp/3521.cpp b/storage/jungol/cpp/completed/3521.cpp similarity index 100% rename from storage/jungol/cpp/3521.cpp rename to storage/jungol/cpp/completed/3521.cpp diff --git a/storage/jungol/cpp/4520.cpp b/storage/jungol/cpp/completed/4520.cpp similarity index 100% rename from storage/jungol/cpp/4520.cpp rename to storage/jungol/cpp/completed/4520.cpp