목록분류 전체보기 (255)
정화 코딩

jest 패키지 설치...apps\admin-backend> pnpm i -D ts-jest @types/jestjest 관련 패키지들을 dev dependencies로 설치해준다. jest 설정 파일 생성...apps\admin-backend> npx ts-jest config:init명령어를 실행하면 package.json 파일에 jest 부분이 추가되거나 따로 별도의 jest.config.json 파일이 생성된다. 나는 초기 세팅시에 만들어져서 변화가 없었다. 별도의 파일로 분리하는 것이 편할 것 같아 package.json 파일에 있던 jest 부분을 삭제하고 다시 명령어를 실행시켜주었다. jest.config.json 파일이 잘 생성된 것을 확인할 수 있다. CommonJS 형식으로 인식할 ..

https://www.acmicpc.net/problem/13549 #include #include #include using namespace std;bool vst[300001];int dx[] = {1, -1};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; queue> q; int cur, cnt; bool fin = false; q.emplace(n, 0); vst[n + 100000] = true; while (!fin) { cur = q.front().first; cnt = q.front()...

https://www.acmicpc.net/problem/1629 #include using namespace std;long long divpow(long long a, long long b, long long c) { if (b == 1) return a % c; long long tmp = divpow(a, b / 2, c) % c; if (b % 2 == 0) return (tmp * tmp) % c; else return (((tmp * tmp) % c) * (a % c)) % c;}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long a, b, c; cin >>..

https://www.acmicpc.net/problem/1865 #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tc; cin >> tc; while (tc--) { int n, m, w; cin >> n >> m >> w; vector> edge; vector dst(n + 1, 100000000); int s, e, t; dst[1] = 0; for (int i = 0; i > s >> e >> t; edge.pus..

문제 상황// src/semester/semester.repository.tsimport { Injectable } from '@nestjs/common';import type { PrismaService } from 'src/prisma/prisma.service';import type { Prisma, Semester } from '@prisma/client';...// src/semester/semester.service.tsimport { Injectable } from '@nestjs/common';import type { SemesterRepository } from './semester.repository';import type { Prisma, Semester } from '@prisma/..

https://www.acmicpc.net/problem/9328 #include #include #include using namespace std;int dx[] = {1, -1, 0, 0};int dy[] = {0, 0, 1, -1};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tc; cin >> tc; while (tc--) { int h, w; cin >> h >> w; vector m(h); vector> chk(h, vector(w, false)); vector open(26, false); queue>..

솔브닥 class 4+ 풀고 있었는데 거기에 피보나치 수 6 문제가 있길래 이참에 피보나치 수 문제를 쭉 풀어볼까 한다. 피보나치 수 (백준 2747번)https://www.acmicpc.net/problem/2747 #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector fib(n + 1); fib[0] = 0; fib[1] = 1; for (int i = 2; i 바텀업 dp로 풀었다. (AC) 피보나치 수 2 (백준 2748번)https://www.acmicpc.net/..

semester.controller.ts 파일 생성생성은 지난 포스트에서 했었다. https://jungh150c.tistory.com/184semester의 create DTO 생성semester 폴더 아래에 새로운 dto 폴더를 만들고 create-semester.dto.ts 파일을 만들어준다....apps\admin-backend> pnpm i class-validatorclass-validator 패키지를 설치해준다.// src/semester/dto/create-semester.dto.tsimport { Season } from '@prisma/client';import { IsInt, IsEnum, IsNotEmpty } from 'class-validator';export class Crea..