문제
101 |입력
103 |출력
105 |제한
107 |예제 입력 {idx + 1}
113 |{input}118 |
예제 출력 {idx + 1}
121 |{output}122 |
├── .github
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── ci.yml
│ ├── deploy.yml
│ └── scoring-deploy-1.yml
├── .gitignore
├── .prettierrc
├── README.md
├── client
├── .eslintrc.json
├── .gitignore
├── axios.ts
├── components
│ ├── Editor
│ │ └── wrapperEditor.tsx
│ ├── GNB
│ │ ├── Logo.tsx
│ │ ├── Menu.tsx
│ │ ├── UserInfo.tsx
│ │ └── index.tsx
│ ├── List
│ │ ├── index.tsx
│ │ ├── list.tsx
│ │ ├── listRow.tsx
│ │ └── paginator.tsx
│ ├── Modal
│ │ ├── DeleteProblemModal.tsx
│ │ └── index.tsx
│ ├── Problem
│ │ ├── CodeContainer.tsx
│ │ └── ProblemContainer.tsx
│ ├── common
│ │ ├── Button.tsx
│ │ └── IOList
│ │ │ ├── InputContainer.tsx
│ │ │ ├── Row.tsx
│ │ │ └── index.tsx
│ ├── paginator.tsx
│ ├── problemList.tsx
│ ├── problemListRow.tsx
│ ├── status
│ │ └── StatusList.tsx
│ └── svgs
│ │ ├── add-file.tsx
│ │ ├── close.tsx
│ │ ├── delete.tsx
│ │ ├── edit.tsx
│ │ ├── index.tsx
│ │ ├── removeRow.tsx
│ │ └── toggle.tsx
├── global.d.ts
├── mock
│ └── problems.ts
├── next.config.js
├── package.json
├── pages
│ ├── _app.tsx
│ ├── _document.tsx
│ ├── api
│ │ ├── problem.tsx
│ │ └── v0
│ │ │ ├── problems
│ │ │ ├── [id].ts
│ │ │ └── [id]
│ │ │ │ ├── submissions.ts
│ │ │ │ ├── tc.ts
│ │ │ │ └── visible.ts
│ │ │ ├── submissions.tsx
│ │ │ ├── submissions
│ │ │ └── [id].ts
│ │ │ └── user
│ │ │ └── login-status.ts
│ ├── index.tsx
│ ├── my-problem
│ │ ├── edit
│ │ │ └── [id].tsx
│ │ ├── index.tsx
│ │ ├── new.tsx
│ │ └── tc
│ │ │ └── [id].tsx
│ ├── problem
│ │ └── [id].tsx
│ ├── status
│ │ ├── [id].tsx
│ │ └── index.tsx
│ └── users
│ │ └── oauth.tsx
├── public
│ └── favicon.ico
├── styles
│ ├── index.ts
│ ├── modal.ts
│ └── style.ts
├── tsconfig.json
└── yarn.lock
├── deploy-client.sh
├── deploy-scoring-server.sh
├── deploy-server.sh
├── deploy.sh
├── scoring-server
├── .dockerignore
├── .eslintrc.js
├── .gitignore
├── README.md
├── docker
│ ├── Dockerfile
│ ├── run.sh
│ └── start.sh
├── nest-cli.json
├── package.json
├── python
│ └── run.py
├── src
│ ├── app.module.ts
│ ├── main.ts
│ ├── queue
│ │ ├── queue.consumer.ts
│ │ └── queue.module.ts
│ └── scoring
│ │ ├── entities
│ │ ├── language.entity.ts
│ │ ├── problem.entity.ts
│ │ ├── submission.entity.ts
│ │ └── testcase.entity.ts
│ │ ├── scoring.module.ts
│ │ └── scoring.service.ts
├── test
│ ├── app.e2e-spec.ts
│ └── jest-e2e.json
├── tsconfig.build.json
├── tsconfig.json
└── yarn.lock
└── server
├── .eslintrc.js
├── .gitignore
├── nest-cli.json
├── package.json
├── src
├── app.module.ts
├── caching
│ ├── caching.module.ts
│ └── caching.service.ts
├── main.ts
├── problems
│ ├── dtos
│ │ ├── create-problem.dto.ts
│ │ ├── post-submission.dto.ts
│ │ ├── post-testcase.dto.ts
│ │ └── update-problem.dto.ts
│ ├── entities
│ │ ├── example.entity.ts
│ │ ├── problem.entity.ts
│ │ └── testcase.entity.ts
│ ├── problems.controller.ts
│ ├── problems.module.ts
│ ├── problems.service.ts
│ └── throttler-behind-proxy.guard.ts
├── submissions
│ ├── dtos
│ │ └── post-result.dto.ts
│ ├── entities
│ │ ├── language.entity.ts
│ │ ├── result.entity.ts
│ │ ├── state.entity.ts
│ │ └── submission.entity.ts
│ ├── submissions.controller.ts
│ ├── submissions.module.ts
│ └── submissions.service.ts
└── users
│ ├── dtos
│ └── github-login.dto.ts
│ ├── entities
│ └── user.entity.ts
│ ├── users.controller.ts
│ ├── users.module.ts
│ └── users.service.ts
├── test
├── app.e2e-spec.ts
└── jest-e2e.json
├── tsconfig.build.json
├── tsconfig.json
└── yarn.lock
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### TO DO
2 |
3 | ### Description
4 |
5 | ### Etc..
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## 개요
2 | - Issue 번호를 적어주세요.
3 | - 내용을 적어주세요.
4 |
5 | ## 작업사항
6 | - 내용을 적어주세요.
7 |
8 | ## 변경로직(optional)
9 | - 내용을 적어주세요.
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Build, Test
2 |
3 | on:
4 | pull_request:
5 | branches: [main, dev]
6 | types: [opened, synchronize]
7 |
8 | jobs:
9 | client-build-test:
10 | defaults:
11 | run:
12 | working-directory: client
13 |
14 | name: Client build test
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v3
19 |
20 | - name: Setup node
21 | uses: actions/setup-node@v3
22 | with:
23 | node-version: 16
24 |
25 | - name: Get yarn cache directory path
26 | id: client-yarn-cache-dir-path
27 | run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
28 |
29 | - uses: actions/cache@v3
30 | id: client-yarn-cache
31 | with:
32 | path: |
33 | ${{ steps.client-yarn-cache-dir-path.outputs.dir }}
34 | ${{ github.workspace }}/client/.next/cache
35 | key: ${{ runner.os }}-client-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/**.[jt]s', '**/**.[jt]sx') }}
36 | restore-keys: |
37 | ${{ runner.os }}-client-yarn-${{ hashFiles('**/yarn.lock') }}-
38 | ${{ runner.os }}-client-yarn-
39 | - name: Install Dependencies
40 | run: yarn install --frozen-lockfile
41 |
42 | - name: Lint
43 | run: yarn lint
44 |
45 | - name: Build
46 | run: yarn build
47 |
48 | server-build-test:
49 | defaults:
50 | run:
51 | working-directory: server
52 |
53 | name: Server build test
54 | runs-on: ubuntu-latest
55 |
56 | steps:
57 | - uses: actions/checkout@v3
58 |
59 | - name: Node
60 | uses: actions/setup-node@v3
61 | with:
62 | node-version: 16
63 |
64 | - name: Get yarn cahce directory path
65 | id: server-yarn-cache-dir-path
66 | run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
67 |
68 | - uses: actions/cache@v3
69 | id: server-yarn-cache
70 | with:
71 | path: ${{ steps.server-yarn-cache-dir-path.outputs.dir }}
72 | key: ${{ runner.os }}-server-yarn-${{ hashFiles('**/yarn.lock') }}
73 | restore-keys: |
74 | ${{ runner.os }}-server-yarn-
75 | - name: Install Dependencies
76 | run: yarn install --frozen-lockfile
77 |
78 | - name: Lint
79 | run: yarn lint
80 |
81 | - name: Test
82 | run: yarn test
83 |
84 | - name: Build
85 | run: yarn build
86 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: 'deploy'
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | workflow_dispatch:
7 |
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: deploy
14 | uses: appleboy/ssh-action@v0.1.4
15 | with:
16 | host: ${{ secrets.SSH_HOST }}
17 | username: ${{ secrets.SSH_USERNAME }}
18 | password: ${{ secrets.SSH_PASSWORD }}
19 | port: ${{ secrets.SSH_PORT }}
20 | script: |
21 | cd ~/web12-MOJ
22 | ./deploy.sh
23 |
--------------------------------------------------------------------------------
/.github/workflows/scoring-deploy-1.yml:
--------------------------------------------------------------------------------
1 | name: 'scoring-deploy-1'
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | workflow_dispatch:
7 |
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: scoring-deploy-1
14 | uses: appleboy/ssh-action@v0.1.4
15 | with:
16 | host: ${{ secrets.SC_SSH_HOST_1 }}
17 | username: ${{ secrets.SC_SSH_USERNAME_1 }}
18 | password: ${{ secrets.SC_SSH_PASSWORD_1 }}
19 | port: ${{ secrets.SC_SSH_PORT_1 }}
20 | script: |
21 | cd ~/web12-MOJ
22 | git pull
23 | ./deploy-scoring-server.sh
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true,
4 | "useTabs": false,
5 | "tabWidth": 2,
6 | "trailingComma": "all",
7 | "printWidth": 80,
8 | "endOfLine": "lf"
9 | }
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MintChoco Online Judge
2 |
3 |
4 |
5 |
{input}118 |
{output}122 |
A progressive Node.js framework for building efficient and scalable server-side applications.
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |