기타/백준
-
Vp 문제에서 '[' 가 추가된 버전([)]은 고려하지 않고 바로 다음 짝 지음만을 판단 using System;using System.Collections.Generic;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { string str = Console.ReadLine(); Stack sta = new Stack(); bool flag = false; while (str[0] != '.') { foreach (in..
백준 c# 4949 균형잡힌 세상Vp 문제에서 '[' 가 추가된 버전([)]은 고려하지 않고 바로 다음 짝 지음만을 판단 using System;using System.Collections.Generic;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { string str = Console.ReadLine(); Stack sta = new Stack(); bool flag = false; while (str[0] != '.') { foreach (in..
2024.06.09 -
괄호의 짝을 판단하는 문제using System;using System.Collections.Generic;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine().Trim()); Stack stack = new Stack(); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i 0) isValid = false; ..
백준 C# 9012 괄호괄호의 짝을 판단하는 문제using System;using System.Collections.Generic;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine().Trim()); Stack stack = new Stack(); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i 0) isValid = false; ..
2024.06.09 -
스택 문제using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine()); Stack stack = new Stack(); int sum =0; for(int i = 0; i 0) { sum -= stack.Pop();..
백준 C# 10773 제로스택 문제using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine()); Stack stack = new Stack(); int sum =0; for(int i = 0; i 0) { sum -= stack.Pop();..
2024.06.06 -
구현하라길래 스택을 만들었는데 시간 초과using System;using System.Linq;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine()); Stack stack = new Stack(iter); for (int i = 0; i int.Parse(x)).ToArray(); switch (numbers[0]) { case 1://스택에 넣기 ..
백준 C# 28278 스택 2구현하라길래 스택을 만들었는데 시간 초과using System;using System.Linq;namespace ConsoleApp1{ internal class Program { static void Main(string[] args) { int iter = int.Parse(Console.ReadLine()); Stack stack = new Stack(iter); for (int i = 0; i int.Parse(x)).ToArray(); switch (numbers[0]) { case 1://스택에 넣기 ..
2024.06.06