[c#] 11659번 구간 합 구하기 4
·
c#/백준알고리즘
https://www.acmicpc.net/problem/11659 11659번: 구간 합 구하기 4 첫째 줄에 수의 개수 N과 합을 구해야 하는 횟수 M이 주어진다. 둘째 줄에는 N개의 수가 주어진다. 수는 1,000보다 작거나 같은 자연수이다. 셋째 줄부터 M개의 줄에는 합을 구해야 하는 구간 i와 j www.acmicpc.net using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace baekjoon27433 { internal class FileName { static void Main(string[] args) { StringBu..
[c#] 274333번 팩토리얼 2
·
c#/백준알고리즘
https://www.acmicpc.net/problem/27433 27433번: 팩토리얼 2 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오. www.acmicpc.net using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace baekjoon27433 { internal class FileName { static void Main(string[] args) { long n= long.Parse(Console.ReadLine()); Console.WriteLine(Facto(n)); } public ..
[백준 15652번 c#] N과 M (4)
·
c#/백준알고리즘
using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Project2 { class Class1 { static StringBuilder sb = new StringBuilder(); static int[] arr; static int N, M; static void Main(string[] args) { StreamWriter writer = new StreamWriter(Console.OpenStandardOutput()); StreamReader read..
[백준 18258번 c#] 큐 2
·
c#/백준알고리즘
using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Project2 { class Class1 { public static int[] stack; public static int indexSize = 0; static void Main(string[] args) { StreamWriter writer = new StreamWriter(Console.OpenStandardOutput()); StreamReader reader = new StreamReader(..
[백준 2798번 c#] 블랙잭
·
c#/백준알고리즘
브루트포스 알고리즘 이 쓰인 문제이다. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Project2 { class Class1 { static void Main(string[] args) { //N,M 값 입력 string[] N_M = Console.ReadLine().Split(); int N = int.Parse(N_M[0]); int M = int.Parse(N_M[1]); //카드에 쓰여진 수 입력 string[] nums = Console.ReadLine().Split(); int[] numsInt = new int..
[유데미] "쉽게 배우는 C# 알고리즘 입문" 리뷰
·
대외활동/starters 부트캠프 feat.웅진씽크빅
최근에 c#에 대해 공부하면서, "알고리즘"에 관심이 생겼습니다. 기본적인 문법 말고, 알고리즘에 대해서만 알려줄 강의가 없나 찾아봤습니다. 프로그래밍 관련한 인기 인강 사이트인 "유데미" 에서 c# 알고리즘을 검색하니, "쉽게 배우는 C# 알고리즘 입문" 강의가 추천으로 나왔습니다. 강의도 "9시간"정도 밖에 안되고, 기초 알고리즘부터 심화 알고리즘까지 잘 정리되어 있어 수강신청을 했습니다. [HD]쉽게 배우는 C# 알고리즘 프로그래밍 Part.1 알고리즘(Algorithm)과 절차 지향 프로그래밍 강의 소개 학습할 알고리즘 리스트 및 강의 소스 다운로드 등 소개 참고_알고리즘 학습 환경 구축_닷넷 개발자를 위한 Visual Studio 설치 합계 알고리즘(Sum Algorithm) 디버거를 사용하여 ..
[백준15552번 c#] 빠른 A+B
·
c#/백준알고리즘
'빠른' 이 핵심 포인트이다 using System; using System.Text; public class Program { public static void Main() { int T = int.Parse(Console.ReadLine()); int[] a = new int[T]; int[] b = new int[T]; StringBuilder sb = new StringBuilder(); for (int i = 0; i < T; i++) { String[] strings = Console.ReadLine().Split(' '); a[i] = int.Parse(strings[0]); b[i] = int.Parse(strings[1]); sb.Append(a[i] + b[i]+"\n"); } Cons..
1. 자료구조와 알고리즘의 이해
·
CS/자료구조
https://gentle-mandolin-ab0.notion.site/1-e5442cdc7ce648baad8b1f1c2e97d8c4 1단원: 자료구조와 알고리즘의 이해 1) 자료구조에 대한 기본적인 이해 gentle-mandolin-ab0.notion.site
[백준/자바]3052번: 나눗셈
·
자바/백준 알고리즘(자바)
-Set은 중복된 값을 가지지 않는 Collection -배열을 Set 타입(HashSet)으로 변환하면, 중복을 제거할 수 있음 -배열의 순서를 보장하면서, 중복을 제거해야 할 때는 LinkedHashSet을 사용 import java.io.IOException; import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; import javax.print.DocFlavor.STRING; public class Main { public static void main(String args[]) throws NumberFormatException, IOException{ Scanner sca..
[백준/자바]2577번: 숫자의 개수/자바/java/
·
자바/백준 알고리즘(자바)
-BufferedReader 사용하여 int로 값 저장 -String.valueOf 로 int를 String으로 변경 -str.charAt(i)을 통해 string을 각각의 char로 바꾸고, 아스키코드 이용하여 arr에 저장해줌 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String args[]) throws NumberFormatException, IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ..