목록JavaScript (35)
HIT해
https://www.acmicpc.net/problem/28279 28279번: 덱 2 첫째 줄에 명령의 수 N이 주어진다. (1 ≤ N ≤ 1,000,000) 둘째 줄부터 N개 줄에 명령이 하나씩 주어진다. 출력을 요구하는 명령은 하나 이상 주어진다. www.acmicpc.net 아래는 내 첫 풀이이다. const filePath = process.platform === 'linux' ? '/dev/stdin' : 'input.txt'; const input = require("fs") .readFileSync(filePath) .toString() .trim() .split("\n"); let TC = input.shift(); //console.log(input); let deck = []; fo..
const filePath = process.platform === 'linux' ? '/dev/stdin' : 'input.txt'; const input = require("fs") .readFileSync(filePath) .toString() .trim() .split("\n"); let TC = input.shift(); hey : for(let i = 0; i < TC; i++){ let tmp = input.shift(); tmp = tmp.trim(); let num = tmp.length; let count = 0; let flag = true; for(let j = 0; j < num; j++){ if(tmp[j] === '('){ count++; }else{ count--; } if(..
// 소수 구하기 // 3 16 const filePath = process.platform === 'linux' ? '/dev/stdin' : 'input.txt'; const input = require("fs") .readFileSync("input.txt") .toString() .trim() .split(" ").map(Number); // console.log("input = " + input) let num1 = input.shift(); let num2 = input.shift(); for(let i = num1; i
https://www.acmicpc.net/problem/1978 1978번: 소수 찾기 첫 줄에 수의 개수 N이 주어진다. N은 100이하이다. 다음으로 N개의 수가 주어지는데 수는 1,000 이하의 자연수이다. www.acmicpc.net const input = require('fs') .readFileSync(__dirname + "/example.txt") .toString().trim() .split("\n"); let I = input.shift(); let box = input[0].split(" ").map(Number); let count = 0; console.log("박스사이즈는 " + box.length); for(let i = 0; i < box.length; i++){ cons..
const words = require('fs') .readFileSync(__dirname + "/example.txt") .toString().trim() .split("\n"); const maxLength = Math.max(...words.map(i => i.trim().length)); console.log("최대길이는" + maxLength); let vertical = ""; for (let i=0; i
https://www.acmicpc.net/problem/2743 2743번: 단어 길이 재기알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.www.acmicpc.net const fs = require('fs');const inputData = fs.readFileSync('input.txt').toString().split('');const a = inputData;console.log(a.length);
const input = require("fs") .readFileSync(__dirname + "/input.txt") .toString() .trim() .split("\n") .map((x) => x.split(" ").map(Number)); let answer = 0; let n = input.shift(); let xMax = -1; let yMax = -1; for (let i = 0; i Array(yMax).fill(0)); for (let i ..
리뷰 객 package com.ssafy.board.model.dto; public class Review { private int num; private int videos_id; private String title; private String content; private String writer_name; private int view_cnt; private String create_time; public Review() {} public int getNum() { return num; } public void setNum(int num) { this.num = num; } public int getVideos_id() { return videos_id; } public void setVideos..