목록Study/Programming (86)
메모장 입니다2
0.type -*args def test(a, *args): print(a, args) print(type(args)) print(len(args)) print(args[0]) test(1,2,3,4,5,6) print('================') test(1,(2,3,4,5,6)) print('================') test(1,*(2,3,4,5,6)) -**kargs 0.type -*argsdef test(a, *args): print(a, args) print(type(args)) print(len(args)) print(args[0]) test(1,2,3,4,5,6) print('================') test(1,(2,3,4,5,6)) print('==========..

1. 튜토리얼 https://regexone.com/ -\d: the character \d can be used in place of any digit from 0 to 9 - . : match any single character \. : match the period character - [abc] : by defining them inside square brackets, the pattern [abc] will only match a single a, b, or c letter and nothing else. -\d: the character \d can be used in place of any digit from 0 to 9 -the pattern [0-6] will only match an..
*원하는 문자가 나오는 지점까지 문자열 자르기 1)str='aaabbbcccdddGive' 에서 Give 전까지 자를거임 2)>>str[:str.rfind("Give")]>>str'aaabbbcccddd'
1.풀이 -이전에 풀었던 Brackets와 동일. 2.소스 https://app.codility.com/demo/results/trainingRSB8GS-M67/ #include #include #include // you can write to stdout for debugging purposes, e.g. // cout
1. 시행착오 -O(N)이라는 것을 보고 하나의 반복문 호출로 해결해야 하는줄 알았다.>그래서 고안한 방법 def solution(A, B): # write your code in Python 3.6 u_c = 0 d_c = 0 d_s = 0 for i in range(len(B)): if B[i] == 1: d_c += 1; if A[i] > d_s: d_s = A[i] elif B[i] == 0: if A[i] > d_s: d_c = 0; u_c += 1; ret = u_c + d_c return ret >하지만, 하류 물고기가 연속적으로 배열되고 중간에 max가 존재할 때 상류 물고기를 만나는 경우는 고려하지 못했다.예를 들어 2,4,3 | 4>그래서 위 경우의 입력 케이스에서 오류가 발생(50점)..
1.설명 -파일을 메모리에 그대로 로드시킨 뒤, 디스크와 연결해준다고 함.>연결 후엔 오브젝트를 생성해주고, 그 오브젝트를 통해 매핑된 파일에 접근 가능.>큰 용량의 파일일 경우, 기존의 방법(Read/Write)보다 빠름. 2.예제 소스 //이상한 이름들이 보이는건 리버싱 문제풀이용으로 사용했던 것이기 때문//함수명만 보면 됨 #include #include #define FILE_NAME L"c:\\work\\CSHARP.exe" int main(int argc, char *argv[]){HANDLE hF, hMapF;DWORD f_size, offset;DWORD area_size;LPWSTR f_start, f_end;PCHAR bb; hF = CreateFileW(FILE_NAME, GENERI..
보호되어 있는 글입니다.
https://app.codility.com/demo/results/trainingJ8R5PA-5X4/ def solution(S): # write your code in Python 3.6 sample = {"{": "}", "[": "]", "(": ")", "}": "{", "]": "[", ")": "("} list = [] ret = 1 second = int(len(S)-1) for x in range(len(S)): if (S[x] == "{") or (S[x] == "[") or (S[x] == "("): list.append(S[x]) else: if len(list) != 0: temp = list.pop() if temp != sample[S[x]]: ret= 0 break else:..