본문 바로가기
728x90

c#102

[ BOJ/C# ] 2941 크로아티아 알파벳 https://www.acmicpc.net/problem/2941 2941번: 크로아티아 알파벳 예전에는 운영체제에서 크로아티아 알파벳을 입력할 수가 없었다. 따라서, 다음과 같이 크로아티아 알파벳을 변경해서 입력했다. 크로아티아 알파벳 변경 č c= ć c- dž dz= đ d- lj lj nj nj š s= ž z= www.acmicpc.net using System; using System.IO; namespace B2941 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStan.. 2023. 11. 6.
[ BOJ/C# ] 1789 수들의 합 https://www.acmicpc.net/problem/1789 1789번: 수들의 합 첫째 줄에 자연수 S(1 ≤ S ≤ 4,294,967,295)가 주어진다. www.acmicpc.net 그렇게 어려운 문제는 아니라고 생각했지만, 한 부분 때문에 계속 Overflow가 떴다. 처음에는 원인을 몰라 이분탐색으로도 하고 자료형도 바꿔보고 별 방법으로 실행해 보았다. 결과적으로 문제는, 입력 부분의 자료형을 습관대로 int.Parse로 해 계속 처음부터 Overflow로 에러가 발생한 것이었다............ using System; using System.IO; namespace B1789 { class Program { static void Main() { StreamReader sr = new.. 2023. 11. 6.
[ BOJ/C# ] 16435 스네이크버드, 골드 https://www.acmicpc.net/problem/16435 16435번: 스네이크버드 첫 번째 줄에 과일의 개수 N (1 ≤ N ≤ 1,000) 과 스네이크버드의 초기 길이 정수 L (1 ≤ L ≤ 10,000) 이 주어집니다. 두 번째 줄에는 정수 h1, h2, ..., hN (1 ≤ hi ≤ 10,000) 이 주어집니다. www.acmicpc.net using System; using System.IO; namespace B16435 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.. 2023. 11. 5.
[ BOJ/C# ] 1427 소트인사이드 https://www.acmicpc.net/problem/1427 1427번: 소트인사이드 첫째 줄에 정렬하려고 하는 수 N이 주어진다. N은 1,000,000,000보다 작거나 같은 자연수이다. www.acmicpc.net using System; using System.IO; namespace B1427 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); string input = sr.ReadLine(); List list = new List(); ;.. 2023. 11. 4.
[ BOJ/C# ] 15829 Hashing https://www.acmicpc.net/problem/15829 15829번: Hashing APC에 온 것을 환영한다. 만약 여러분이 학교에서 자료구조를 수강했다면 해시 함수에 대해 배웠을 것이다. 해시 함수란 임의의 길이의 입력을 받아서 고정된 길이의 출력을 내보내는 함수로 정 www.acmicpc.net 문제를 풀 수록 해싱과 관련된 문제들이 나와 한번 제대로 공부해야겠다고 생각하였다. 공부하긴 했지만 아직 크게 와닿지는 않는다. 활용한 문제들을 더 풀어봐야겠다. using System; using System.IO; namespace B15829 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.O.. 2023. 11. 3.
[ BOJ/C# ] 1110 더하기 사이클 https://www.acmicpc.net/problem/1110 1110번: 더하기 사이클 0보다 크거나 같고, 99보다 작거나 같은 정수가 주어질 때 다음과 같은 연산을 할 수 있다. 먼저 주어진 수가 10보다 작다면 앞에 0을 붙여 두 자리 수로 만들고, 각 자리의 숫자를 더한다. 그 다음, www.acmicpc.net using System; using System.IO; namespace B1110 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()).. 2023. 11. 2.
728x90