diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.cpp" new file mode 100644 index 0000000..1e201a8 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.cpp" @@ -0,0 +1,31 @@ +#include +#include +using namespace std; + +int main() +{ + int N, M; + scanf("%d %d", &N, &M); + + vector vec(N + 1); + for (int i = 1; i <= N; i++) + { + int num; + scanf("%d", &num); + vec[i] = num % M; + } + + vector acc_remain_cnt(M); + int cur_remain = 0; + acc_remain_cnt[cur_remain]++; + long long ans = 0; + + for (int i = 1; i <= N; i++) + { + cur_remain = (cur_remain + vec[i]) % M; + ans += acc_remain_cnt[cur_remain]; + acc_remain_cnt[cur_remain]++; + } + printf("%lld\n", ans); + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.py" new file mode 100644 index 0000000..dc2f3d3 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986.py" @@ -0,0 +1,12 @@ +N, M = map(int, input().split()) +li = list(map(int, input().split())) + +acc_remain_cnt = [0] * M +acc_remain_cnt[cur_remain := 0] = 1 +ans = 0 + +for x in li: + ans += acc_remain_cnt[cur_remain := (cur_remain + x) % M] + acc_remain_cnt[cur_remain] += 1 + +print(ans) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986_map.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986_map.cpp" new file mode 100644 index 0000000..f9b395b --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/10986_\353\202\230\353\250\270\354\247\200\355\225\251/10986_map.cpp" @@ -0,0 +1,27 @@ +#include +#include +#include +using namespace std; + +int main() +{ + int N, M; + scanf("%d %d", &N, &M); + + int cur_remain = 0; + map remain_cnt; + remain_cnt[cur_remain] = 1; + long long ans = 0; + + for (int i = 0; i < N; i++) + { + int num; + scanf("%d", &num); + cur_remain = (cur_remain + num) % M; + ans += remain_cnt[cur_remain]; + remain_cnt[cur_remain]++; + } + + printf("%lld\n", ans); + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.cpp" new file mode 100644 index 0000000..3d3d8bb --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.cpp" @@ -0,0 +1,45 @@ +#include +#include +#include +#include +using namespace std; + +bool can_make_num(int x, bool is_broken[10]) +{ + if (x == 0) + return !is_broken[0]; + while (x > 0) + { + if (is_broken[x % 10]) + return false; + x /= 10; + } + return true; +} + +int main() +{ + int N, M; + scanf("%d %d", &N, &M); + + bool is_broken[10]; + memset(is_broken, 0, sizeof(is_broken)); + + for (int i = 0; i < M; i++) + { + int broken; + scanf("%d", &broken); + is_broken[broken] = true; + } + + int ans = N > 100 ? N - 100 : 100 - N; + for (int delta = 0; delta < ans; delta++) + { + int number_to_make[2] = { N + delta, N - delta }; + for (auto& num : number_to_make) + if (num >= 0 && can_make_num(num, is_broken)) + ans = min(ans, (int)to_string(num).length() + delta); + } + printf("%d\n", ans); + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.py" new file mode 100644 index 0000000..c007d2d --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1107_\353\246\254\353\252\250\354\273\250/1107.py" @@ -0,0 +1,23 @@ +N = int(input()) +M = int(input()) +broken = [] if M == 0 else list(map(int,input().split())) +is_broken = [1 if i in broken else 0 for i in range(10)] + +def can_make_num(x): + if x == 0: + return not(is_broken[0]) + while x > 0: + if is_broken[x % 10]: + return 0 + x //= 10 + return 1 + + +ans = N - 100 if N > 100 else 100 - N +for delta in range(ans): + num_to_make = [N + delta, N - delta] + for num in num_to_make: + if num >= 0 and can_make_num(num): + ans = min(ans, len(str(num)) + delta) + +print(ans) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.cpp" new file mode 100644 index 0000000..1ae84e4 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.cpp" @@ -0,0 +1,60 @@ +#include +#include +#include +#include +using namespace std; + +int get_sum(int top, int left, int bottom, int right, int acc[52][52]) +{ + return (acc[bottom][right] - acc[bottom][left - 1] - acc[top - 1][right] + acc[top - 1][left - 1]); +} + +int main() +{ + int N, acc[52][52]; + scanf("%d", &N); + + for (int i = 1; i <= N; i++) + { + for (int j = 1; j <= N; j++) + { + int num; + scanf("%d", &num); + acc[i][j] = acc[i][j - 1] + acc[i - 1][j] - acc[i - 1][j - 1] + num; + } + } + + int ans = 0; + for (int r1 = 1; r1 < N; r1++) + { + for (int c1 = 1; c1 < N; c1++) + { + vector lt_vertex, lb_vertex; + map rt_vertex, rb_vertex; + + for (int r2 = 1; r2 <= r1; r2++) + { + for (int c2 = 1; c2 <= c1; c2++) + lt_vertex.push_back(get_sum(r2, c2, r1, c1, acc)); + for (int c2 = c1 + 1; c2 <= N; c2++) + lb_vertex.push_back(get_sum(r2, c1 + 1, r1, c2, acc)); + } + + for (int r2 = r1 + 1; r2 <= N; r2++) + { + for (int c2 = 1; c2 <= c1; c2++) + rt_vertex[get_sum(r1 + 1, c2, r2, c1, acc)]++; + for (int c2 = c1 + 1; c2 <= N; c2++) + rb_vertex[get_sum(r1 + 1, c1 + 1, r2, c2, acc)]++; + } + + for (auto& score : lt_vertex) + ans += rb_vertex[score]; + for (auto& score : lb_vertex) + ans += rt_vertex[score]; + } + } + + printf("%d\n", ans); + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.py" new file mode 100644 index 0000000..c0cf705 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1184_\352\267\200\353\206\215/1184.py" @@ -0,0 +1,31 @@ +from collections import defaultdict + +N = int(input()) +acc = [[0] * (N + 1) for _ in range(N + 1)] + +def get_sum(top, left, bottom, right): + return acc[bottom][right] - acc[bottom][left - 1] - acc[top - 1][right] + acc[top - 1][left - 1] + +for i in range(1, N + 1): + row = list(map(int, input().split())) + for j in range(1, N + 1): + acc[i][j] = acc[i][j - 1] + acc[i - 1][j] - acc[i - 1][j - 1] + row[j - 1] + +ans = 0 +for r1 in range(1, N): + for c1 in range(1, N): + lt_vertex = defaultdict(int) + lb_vertex = defaultdict(int) + for r2 in range(1, r1 + 1): + for c2 in range(1, c1 + 1): + lt_vertex[get_sum(r2, c2, r1, c1)] += 1 + for c2 in range(c1 + 1, N + 1): + lb_vertex[get_sum(r2, c1 + 1, r1, c2)] += 1 + + for r2 in range(r1 + 1, N + 1): + for c2 in range(1, c1 + 1): + ans += lb_vertex[get_sum(r1 + 1, c2, r2, c1)] + for c2 in range(c1 + 1, N + 1): + ans += lt_vertex[get_sum(r1 + 1, c1 + 1, r2, c2)] + +print(ans) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.cpp" new file mode 100644 index 0000000..df3c9f7 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.cpp" @@ -0,0 +1,36 @@ +#include +#include +#include +#include +using namespace std; + +int main() +{ + ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); + + int N, M; + cin >> N >> M; + + string name; + set unhear; + for (int i = 0; i < N; i++) + { + cin >> name; + unhear.insert(name); + } + + vector ans; + for (int i = 0; i < M; i++) + { + cin >> name; + if (unhear.find(name) != unhear.end()) + ans.push_back(name); + } + + sort(ans.begin(), ans.end()); + cout << ans.size() << '\n'; + for (auto& name : ans) + cout << name << '\n'; + + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.py" new file mode 100644 index 0000000..40b36ce --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_set.py" @@ -0,0 +1,15 @@ +import sys +input = sys.stdin.readline + +N, M = map(int, input().split()) +unhear = set(input().rstrip() for _ in range(N)) + +ans = [] +for x in [input().rstrip() for _ in range(M)]: + if x in unhear: + ans.append(x) + +ans.sort() +print(len(ans)) +for name in ans: + print(name) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.cpp" new file mode 100644 index 0000000..2b42077 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.cpp" @@ -0,0 +1,40 @@ +#include +#include +#include +#include +using namespace std; + +int main() +{ + ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); + + int N, M; + cin >> N >> M; + + vector unhear(N); + for (int i = 0; i < N; i++) + cin >> unhear[i]; + + vector unseen(M); + for (int i = 0; i < M; i++) + cin >> unseen[i]; + + sort(unhear.begin(), unhear.end()); + sort(unseen.begin(), unseen.end()); + + int pair_idx = 0; + vector ans; + for (int i = 0; i < N; i++) + { + while (pair_idx < M && unseen[pair_idx] < unhear[i]) + pair_idx++; + if (pair_idx < M && unseen[pair_idx] == unhear[i]) + ans.push_back(unhear[i]); + } + + cout << ans.size() << '\n'; + for (auto& name : ans) + cout << name << '\n'; + + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.py" new file mode 100644 index 0000000..5f04f3f --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1764_\353\223\243\353\263\264\354\236\241/1764_two_pointer.py" @@ -0,0 +1,18 @@ +import sys +input = sys.stdin.readline + +N, M = map(int, input().split()) +unhear = sorted([input().rstrip() for _ in range(N)]) +unseen = sorted([input().rstrip() for _ in range(M)]) + +pair_idx = 0 +ans = [] +for x in unhear: + while pair_idx < M and unseen[pair_idx] < x: + pair_idx += 1 + if pair_idx < M and unseen[pair_idx] == x: + ans.append(x) + +print(len(ans)) +for name in ans: + print(name) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.cpp" new file mode 100644 index 0000000..454bc5c --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.cpp" @@ -0,0 +1,54 @@ +#include +#include +#include +using namespace std; + +bool is_exist(vector>& acc, int N, int M, int len) +{ + for (int i = 1; i <= N - len + 1; i++) + { + for (int j = 1; j <= M - len + 1; j++) + { + int count = acc[i + len - 1][j + len - 1] - acc[i + len - 1][j - 1] - acc[i - 1][j + len - 1] + acc[i - 1][j - 1]; + if (count == len * len) + return true; + } + } + return false; +} + +int main() +{ + int N, M; + scanf("%d %d", &N, &M); + + char row[1001]; + vector> acc(N + 1, vector(M + 1)); + for (int i = 1; i <= N; i++) + { + scanf(" %s", row); + for (int j = 1; j <= M; j++) + { + acc[i][j] = acc[i - 1][j] + acc[i][j - 1] - acc[i - 1][j - 1]; + if (row[j - 1] == '1') + acc[i][j]++; + } + } + + int l = 1; + int r = min(N, M); + int ans = 0; + while (l <= r) + { + int m = (l + r) / 2; + if (is_exist(acc, N, M, m)) + { + ans = m * m; + l = m + 1; + } + else + r = m - 1; + } + printf("%d\n", ans); + return 0; +} diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.py" new file mode 100644 index 0000000..c8f8bbd --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/1915_\352\260\200\354\236\245\355\201\260\354\240\225\354\202\254\352\260\201\355\230\225/1915.py" @@ -0,0 +1,18 @@ +N, M = map(int, input().split()) +arr = [input() for _ in range(N)] +res = [[0] * M for _ in range(N)] + +for row in range(0, N): + if arr[row][0] == '1': + res[row][0] = 1 + +for col in range(0, M): + if arr[0][col] == '1': + res[0][col] == 1 + +for row in range(1, N): + for col in range(1, M): + if arr[row][col] == '1': + res[row][col] = min(res[row - 1][col - 1], res[row - 1][col], res[row][col - 1]) + 1 + +print(max(map(max, res)) ** 2) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473.two_pointer.py" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473.two_pointer.py" new file mode 100644 index 0000000..3d846bc --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473.two_pointer.py" @@ -0,0 +1,19 @@ +N = int(input()) +arr = sorted(list(map(int,input().split()))) +ans = arr[:3] +ans_abs = abs(sum(ans)) + +for i in range(N - 2): + left_idx, right_idx = i + 1, N - 1 + while left_idx < right_idx: + cur_sum = arr[i] + arr[left_idx] + arr[right_idx] + cur_abs = abs(cur_sum) + if ans_abs > cur_abs: + ans = [arr[i], arr[left_idx], arr[right_idx]] + ans_abs = cur_abs + if cur_sum <= 0: + left_idx += 1 + else: + right_idx -= 1 + +print(' '.join(map(str, ans))) diff --git "a/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473_two_pointer.cpp" "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473_two_pointer.cpp" new file mode 100644 index 0000000..8ac5330 --- /dev/null +++ "b/Part1_\352\260\225\354\235\230\354\236\220\353\243\214/Part1_\354\227\260\354\212\265\353\254\270\354\240\234_\355\222\200\354\235\264/2473_\354\204\270\354\232\251\354\225\241/2473_two_pointer.cpp" @@ -0,0 +1,45 @@ +#include +#include +#include +#include +using namespace std; + +int main() +{ + int N; + scanf("%d", &N); + + vector vec(N); + for (int i = 0; i < N; i++) + scanf("%d", &vec[i]); + sort(vec.begin(), vec.end()); + + int ans1 = vec[0]; + int ans2 = vec[1]; + int ans3 = vec[2]; + long long ans_abs = abs((long long)vec[0] + vec[1] + vec[2]); + for (int i = 0; i < N - 2; i++) + { + int left_idx = i + 1; + int right_idx = N - 1; + while (left_idx < right_idx) + { + long long cur_sum = (long long)vec[i] + vec[left_idx] + vec[right_idx]; + long long cur_abs = abs(cur_sum); + if (ans_abs > cur_abs) + { + ans1 = vec[i]; + ans2 = vec[left_idx]; + ans3 = vec[right_idx]; + ans_abs = cur_abs; + } + if (cur_sum <= 0) + left_idx++; + else + right_idx--; + } + } + + printf("%d %d %d", ans1, ans2, ans3); + return 0; +}