Skip to content

Commit

Permalink
Algorithm: Solve baekjoon-4949
Browse files Browse the repository at this point in the history
  • Loading branch information
fkdl0048 committed Aug 30, 2023
1 parent f95321e commit 5978d2d
Show file tree
Hide file tree
Showing 29 changed files with 340 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 2023/baekjoon_4949/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "baekjoon_4949.sln"
}
55 changes: 55 additions & 0 deletions 2023/baekjoon_4949/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace baekjoon_4949
{
public class ValidStringReader
{
private char[] brackets;

public bool Read(string input)
{
brackets = new char[100];

int index = 0;
foreach (var c in input)
{
if (c == '(' || c == '[')
{
brackets[index++] = c;
}
else if (c == ')')
{
if (index == 0 || brackets[--index] != '(')
{
return false;
}
}
else if (c == ']')
{
if (index == 0 || brackets[--index] != '[')
{
return false;
}
}
}

return index == 0;
}
}

public class Program
{
public static void Main(string[] args)
{
var reader = new ValidStringReader();
while (true)
{
var input = System.Console.ReadLine();
if (input == ".")
{
break;
}

System.Console.WriteLine(reader.Read(input) ? "yes" : "no");
}
}
}
}
10 changes: 10 additions & 0 deletions 2023/baekjoon_4949/baekjoon_4949.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
25 changes: 25 additions & 0 deletions 2023/baekjoon_4949/baekjoon_4949.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "baekjoon_4949", "baekjoon_4949.csproj", "{4A3C29D5-7E32-4715-8C87-464EA9331257}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4A3C29D5-7E32-4715-8C87-464EA9331257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A3C29D5-7E32-4715-8C87-464EA9331257}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A3C29D5-7E32-4715-8C87-464EA9331257}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A3C29D5-7E32-4715-8C87-464EA9331257}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66087266-1F40-4461-AFE1-9D675C957AAC}
EndGlobalSection
EndGlobal
23 changes: 23 additions & 0 deletions 2023/baekjoon_4949/bin/Debug/net7.0/baekjoon_4949.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"baekjoon_4949/1.0.0": {
"runtime": {
"baekjoon_4949.dll": {}
}
}
}
},
"libraries": {
"baekjoon_4949/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
Binary file added 2023/baekjoon_4949/obj/Debug/net7.0/apphost.exe
Binary file not shown.
22 changes: 22 additions & 0 deletions 2023/baekjoon_4949/obj/Debug/net7.0/baekjoon_4949.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("baekjoon_4949")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("baekjoon_4949")]
[assembly: System.Reflection.AssemblyTitleAttribute("baekjoon_4949")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// MSBuild WriteCodeFragment 클래스에서 생성되었습니다.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb20759277607c796e66cb3aa46bf24d59328ef5
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = baekjoon_4949
build_property.ProjectDir = D:\Algorithm\2023\baekjoon_4949\
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
afd72929058c68147526a90eb6aa13b557c82bfb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
D:\Algorithm\2023\baekjoon_4949\bin\Debug\net7.0\baekjoon_4949.exe
D:\Algorithm\2023\baekjoon_4949\bin\Debug\net7.0\baekjoon_4949.deps.json
D:\Algorithm\2023\baekjoon_4949\bin\Debug\net7.0\baekjoon_4949.runtimeconfig.json
D:\Algorithm\2023\baekjoon_4949\bin\Debug\net7.0\baekjoon_4949.dll
D:\Algorithm\2023\baekjoon_4949\bin\Debug\net7.0\baekjoon_4949.pdb
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.csproj.AssemblyReference.cache
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.GeneratedMSBuildEditorConfig.editorconfig
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.AssemblyInfoInputs.cache
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.AssemblyInfo.cs
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.csproj.CoreCompileInputs.cache
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.dll
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\refint\baekjoon_4949.dll
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.pdb
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\baekjoon_4949.genruntimeconfig.cache
D:\Algorithm\2023\baekjoon_4949\obj\Debug\net7.0\ref\baekjoon_4949.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
860978e91ed45aa778bfe1024a9dff2a38f2ae1e
Binary file not shown.
Binary file not shown.
Binary file not shown.
61 changes: 61 additions & 0 deletions 2023/baekjoon_4949/obj/baekjoon_4949.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"format": 1,
"restore": {
"D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj": {}
},
"projects": {
"D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj",
"projectName": "baekjoon_4949",
"projectPath": "D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj",
"packagesPath": "C:\\Users\\USER\\.nuget\\packages\\",
"outputPath": "D:\\Algorithm\\2023\\baekjoon_4949\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\USER\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}
}
15 changes: 15 additions & 0 deletions 2023/baekjoon_4949/obj/baekjoon_4949.csproj.nuget.g.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\USER\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\USER\.nuget\packages\" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions 2023/baekjoon_4949/obj/baekjoon_4949.csproj.nuget.g.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
66 changes: 66 additions & 0 deletions 2023/baekjoon_4949/obj/project.assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"version": 3,
"targets": {
"net7.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net7.0": []
},
"packageFolders": {
"C:\\Users\\USER\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj",
"projectName": "baekjoon_4949",
"projectPath": "D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj",
"packagesPath": "C:\\Users\\USER\\.nuget\\packages\\",
"outputPath": "D:\\Algorithm\\2023\\baekjoon_4949\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\USER\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}
8 changes: 8 additions & 0 deletions 2023/baekjoon_4949/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "J3DlR/f7ZjH1jFEATlnbQ9318Qz7uGXZneo9EEITJ0noMMEm4pfKMCLJ+BTX5lhCsUiXcgLi749EAIU+U0UW/A==",
"success": true,
"projectFilePath": "D:\\Algorithm\\2023\\baekjoon_4949\\baekjoon_4949.csproj",
"expectedPackageFiles": [],
"logs": []
}

0 comments on commit 5978d2d

Please sign in to comment.