npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

psoj

v1.3.1

Published

problem solving offline judge CLI

Downloads

38

Readme

개요

백준 이나 코드포스 문제를 풀 때 여러 케이스를 실행하여 결과를 보여줍니다.

PSOJ = Problem Solving Offline Judge

설치

  1. node.js 를 설치합니다.
  2. npx (장점: 자동 업데이트), psoj (장점: 명령어가 짧아짐) 중에 하나를 설치합니다.
$ npm install -g npx

or

$ npm install -g psoj
  1. 사용하고자 하는 언어(c, python, ...) 의 컴파일러나 인터프리터를 설치합니다.

사용법

$ npx psoj <keyword>

or

$ psoj <keyword>

keyword 를 포함한 디렉토리의 소스파일이 실행됩니다. 컴파일이 필요한 경우 컴파일 후 실행됩니다. (실행 후 삭제)

  • -f <filename> : filename 을 우선적으로 실행합니다. (확장자까지 입력)
  • -d : 오답일 경우 다른 부분을 표시하여 보여줍니다.
  • -t <keyword> : 테스트케이스 범위를 줄여줍니다.

지원하는 언어

| 언어 | 확장자 | 명령어 | 비고 | | ---------- | ------------ | -------------------- | ---- | | c | .c | gcc | | | c++ | .cc .cpp | g++ | | | c# | .cs | csc mono | | | golang | .go | go | | | java | .java | javac java | | | kotlin | .kt | kotlinc-jvm java | | | nodejs | .js | node | | | typescript | .ts | tsc | | | python3 | .py | python3 | | | php | .php | php | | | ruby | .rb | ruby | | | rust | .rs | rustc | |

문제풀이 디렉토리 구조 예시

├── math
│   ├── 1000
│   │   ├── 1.in
│   │   ├── 1.out
│   │   ├── 2.in
│   │   ├── 2.out
│   │   ├── 3.input.txt
│   │   ├── 3.output.txt
│   │   ├── main.cc
│   │   └── main.py
│   └── 1001
│        ├── 1.in
│        └── main.js
├── search
│   ├── 1012

1001 디렉토리와 같이 정답파일이 없어도 실행 가능합니다.

실행결과: 정답파일이 있는 경우

$ npx psoj 1000
Source: math/1000/main.py

✔  1.in 49.37ms
✔  2.in 52.50ms
✘  3.input.txt 56.29ms

expected:
40
actual:
30

2/3 cases passed.

실행결과: 정답파일이 없는 경우

$ npx psoj 1001
Source: math/1001/main.js

☐  1.in 54.77ms

actual:
30

1 unknown case.

설정파일

npx psoj 를 실행하는 디렉토리에 psoj.json 파일을 생성하여 다음과 같은 옵션을 설정할 수 있습니다. (선택사항)

{
  "extensions": ["js", "java"],
  "sourceNames": ["main", "index", "problem"]
}
  • extensions: 확장자 우선순위
  • sourceNames: 같은 확장자일때 이름 우선순위

소스파일이 2개 이상일때부터 의미가 있는 옵션입니다. 소스파일이 1개인 경우에는 그 소스파일이 실행됩니다.

지원 운영체제

  • Linux
  • Windows bash
  • MacOS

사용에 이상이 있으신 분은 부담없이 이슈를 올려주세요.