diff --git a/src/week5/BOJ1912/BOJ1912_V1.cpp b/src/week5/BOJ1912/BOJ1912_V1.cpp new file mode 100644 index 0000000..bbc1d7e --- /dev/null +++ b/src/week5/BOJ1912/BOJ1912_V1.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; +int main() { + + ios_base::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + int n; + int ret = -1004; + cin >> n; + + int sum = 0; + for (int i=0; i> num; + sum += num; + ret = max(ret, sum); + if (sum < 0) sum = 0; + } + + cout << ret; + + return 0; +} \ No newline at end of file