diff --git a/code_study/Baekjoon/c/2143.c b/code_study/Baekjoon/c/2143.c new file mode 100644 index 0000000..fc42d35 --- /dev/null +++ b/code_study/Baekjoon/c/2143.c @@ -0,0 +1,80 @@ +#include +#include + +#define MAX_SIZE 500500 + +int N, M, T; +int A[1000], B[1000]; +long long sumA[MAX_SIZE], sumB[MAX_SIZE]; + +int compare(const void* a, const void* b) { + long long x = *(long long*)a; + long long y = *(long long*)b; + + if(x < y) return -1; + else if(x > y) return 1; + return 0; +} + +int main() { + scanf("%d",&T); + + scanf("%d",&N); + for(int i=0; i= 0) { + long long temp = sumA[ptA] + sumB[ptB]; + + if(temp != T) { + if(T > temp) ptA++; + else ptB--; + continue; + } + + int same_count_A = 0; + int current_sumA = sumA[ptA]; + while(ptA < sumA_size && sumA[ptA] == current_sumA) { + ptA++; + same_count_A++; + } + + int same_count_B = 0; + int current_sumB = sumB[ptB]; + while(ptB >= 0 && sumB[ptB] == current_sumB) { + ptB--; + same_count_B++; + } + + ans += (long long)same_count_A * same_count_B; + } + + printf("%lld\n",ans); + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/python/5524.py b/code_study/Baekjoon/python/5524.py new file mode 100644 index 0000000..a0df470 --- /dev/null +++ b/code_study/Baekjoon/python/5524.py @@ -0,0 +1,3 @@ +import sys +input = sys.stdin.readline +print("".join([input().lower() for _ in range(int(input()))])) \ No newline at end of file