분류 전체보기 226

[MySQL] 3. 175. Combine Two Tables [LeetCode Easy]

https://leetcode.com/problems/combine-two-tables/ 해석: Write an SQL query to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present in the Address table, report null instead. cs firstName , lastName, city, state를 출력하라, 그러나 Address table에 personId가 없으면, null을 리턴하라는 내용입니다. Person table과 Address table이 나오며 Null이 나오니, 두 테이블을 합..

Leetcode 2022.05.25

[LeetCode Medium] 3. Longest Substring Without Repeating Characters [C/C++]

https://leetcode.com/problems/longest-substring-without-repeating-characters/ Longest Substring Without Repeating Characters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 해석 Given a string s, find the length of the longest substring without repeating characters. String s에서 가장 긴..

Leetcode 2022.05.25

빠른 입출력 [node JS] 백준 15552번 - 빠른 A+B, 최대한 다양하게

https://www.acmicpc.net/problem/15552 15552번: 빠른 A+B 첫 줄에 테스트케이스의 개수 T가 주어진다. T는 최대 1,000,000이다. 다음 T줄에는 각각 두 정수 A와 B가 주어진다. A와 B는 1 이상, 1,000 이하이다. www.acmicpc.net 1. 코드 아쉽게도 이 문제는 node JS의 빠른 입출력 중 하나인 require('fs').readFileSync('/dev/stdin').toString().split('\n'); 로만 통과할 수 있습니다. ㅇㄴㅇ let input = require('fs').readFileSync('/dev/stdin').toString().split('\n'); let max = Number(input[0]); let a..

빠른 입출력 [C#] 백준 15552번 - 빠른 A+B, 최대한 다양하게

https://www.acmicpc.net/problem/15552 15552번: 빠른 A+B 첫 줄에 테스트케이스의 개수 T가 주어진다. T는 최대 1,000,000이다. 다음 T줄에는 각각 두 정수 A와 B가 주어진다. A와 B는 1 이상, 1,000 이하이다. www.acmicpc.net 1. 이해하기 쉬운 코드 using System; using System.Text; using System.IO; namespace backjoonmmmmmm { public class Program { public static void Main(string[] args) { StreamReader sr = new StreamReader(new BufferedStream(Console.OpenStandardInpu..

빠른 입출력 [C/C++] 백준 15552번 - 빠른 A+B, 최대한 다양하게

https://www.acmicpc.net/problem/15552 15552번: 빠른 A+B 첫 줄에 테스트케이스의 개수 T가 주어진다. T는 최대 1,000,000이다. 다음 T줄에는 각각 두 정수 A와 B가 주어진다. A와 B는 1 이상, 1,000 이하이다. www.acmicpc.net 핵심 아래의 코드를 main에 넣으시면 cin과 cout의 속도가 비약적으로 상승합니다. ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cs 혹은 아래와 같은 방식으로 적으시고 main에 fastio()를 선언해 줍니다. #define fastio() ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); cs 1..

[C/C++] 백준 1004번 - 어린 왕자, 새롭게 Class로 풀어보자

https://www.acmicpc.net/problem/1004 1004번: 어린 왕자 입력의 첫 줄에는 테스트 케이스의 개수 T가 주어진다. 그 다음 줄부터 각각의 테스트케이스에 대해 첫째 줄에 출발점 (x1, y1)과 도착점 (x2, y2)이 주어진다. 두 번째 줄에는 행성계의 개수 n이 주 www.acmicpc.net 클래스로 풀어보았습니다. 완성된 코드 #include #include using namespace std; static const auto fastio = []() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); return 0; }(); class space { int y1, x1,..