Giter Club home page Giter Club logo

algorithm's Introduction

코테 ><

// js readline
const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

let input = [];

rl.on('line', function (line) {
  input.push(line);
}).on('close', function () {
  console.log(input);
  process.exit();
});
// js 배열 0으로 초기화
const arr = Array.from({ length: N }, () => 0);

// 2차원 배열 선언
graph = [...Array(N + 1)].map(() => []);
visited = [...Array(N + 1)].fill(false);

// 여러 줄에 문자열 입력받고 하나씩 저장) [[1, 2, 3], [3, 4, 5]]
const arr = input.splice(1);
const matrix = [...Array(N)].map((_, idx) => arr[idx].split(''));

백준의 입력은 EOF가 있지만 터미널에 입력을하면 ctrl^c로 명시적 EoF를 줘야함

algorithm's People

Contributors

eunnho98 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.