diff --git a/run.py b/run.py index 31d127e..68c0d69 100644 --- a/run.py +++ b/run.py @@ -27,7 +27,7 @@ class ProblemRunEnum: zeta_C: ProblemRunType = ProblemRunType( name="zeta_C", dir="./zeta_C", - runner="gcc -std=c11 {source} && ./a.out < {input}", + runner="gcc -std=c11 {source} && a.out", prefix="c", ) zeta_cpp: ProblemRunType = ProblemRunType( diff --git a/zeta_C/1620.c b/zeta_C/completed/1620.c similarity index 100% rename from zeta_C/1620.c rename to zeta_C/completed/1620.c diff --git a/zeta_cpp/completed/1448.cpp b/zeta_cpp/completed/1448.cpp new file mode 100644 index 0000000..f624eb9 --- /dev/null +++ b/zeta_cpp/completed/1448.cpp @@ -0,0 +1,30 @@ +#include +#include +#include + +using namespace std; + +int get_max(int N, int *S) { + for (int i = 0; i < N - 2; i++) { + if (S[i] < S[i + 1] + S[i + 2]) return S[i] + S[i + 1] + S[i + 2]; + } + return -1; +} + +int main() { + + int N; + int S[1000000]; + + cin >> N; + + for (int i = 0; i < N; i++) { + cin >> S[i]; + } + + sort(S, S + N, greater<>()); + + cout << get_max(N, S) << endl; + + return 0; +} \ No newline at end of file