From 12a780105e4940bbb32d19955ac497b5917f3d7f Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Tue, 15 Oct 2024 15:43:55 +0900 Subject: [PATCH] Add 32327.cpp --- 32xxx/32327.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 32xxx/32327.cpp diff --git a/32xxx/32327.cpp b/32xxx/32327.cpp new file mode 100644 index 00000000..4203b14d --- /dev/null +++ b/32xxx/32327.cpp @@ -0,0 +1,23 @@ +#include +#include +using namespace std; + +void solve(void) { + int d; cin >> d; + + vector v; int x; + while (cin >> x) v.push_back(x); + for (int x : v) { + if (d <= x) break; + d += x; + } + cout << d; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file