first commit
This commit is contained in:
6
ProblemOne/App.config
Normal file
6
ProblemOne/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
53
ProblemOne/ProblemOne.csproj
Normal file
53
ProblemOne/ProblemOne.csproj
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{58FECE0A-7AC6-47CC-A93A-6D843FC040A0}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ProblemOne</RootNamespace>
|
||||
<AssemblyName>ProblemOne</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
153
ProblemOne/Program.cs
Normal file
153
ProblemOne/Program.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProblemOne
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(GetTotalFuelRequiredPartOne());
|
||||
Console.WriteLine(GetTotalFuelRequiredPartTwo());
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
static int GetTotalFuelRequiredPartTwo()
|
||||
{
|
||||
var totalFuelRequired = 0;
|
||||
foreach (var massInput in MassInputs)
|
||||
{
|
||||
var fuelRequired = massInput;
|
||||
do
|
||||
{
|
||||
fuelRequired = GetFuelRequiredPartOne(fuelRequired);
|
||||
totalFuelRequired += fuelRequired;
|
||||
}
|
||||
while (GetFuelRequiredPartOne(fuelRequired) > 0);
|
||||
}
|
||||
|
||||
return totalFuelRequired;
|
||||
}
|
||||
|
||||
static int GetTotalFuelRequiredPartOne()
|
||||
{
|
||||
var totalFuelRequired = 0;
|
||||
foreach (var massInput in MassInputs)
|
||||
totalFuelRequired += GetFuelRequiredPartOne(massInput);
|
||||
|
||||
return totalFuelRequired;
|
||||
}
|
||||
|
||||
static int GetFuelRequiredPartOne(int massInput)
|
||||
{
|
||||
return (int)(Math.Floor(massInput / 3.0M) - 2.0M);
|
||||
}
|
||||
|
||||
static List<int> MassInputs = new List<int>()
|
||||
{
|
||||
92349,
|
||||
57040,
|
||||
64079,
|
||||
121555,
|
||||
143735,
|
||||
64642,
|
||||
104858,
|
||||
144446,
|
||||
88871,
|
||||
62338,
|
||||
113424,
|
||||
59960,
|
||||
53999,
|
||||
86867,
|
||||
67224,
|
||||
124130,
|
||||
108921,
|
||||
130492,
|
||||
120361,
|
||||
74426,
|
||||
70397,
|
||||
88106,
|
||||
125442,
|
||||
74237,
|
||||
137818,
|
||||
66633,
|
||||
71756,
|
||||
143276,
|
||||
143456,
|
||||
135698,
|
||||
121124,
|
||||
67739,
|
||||
112861,
|
||||
78572,
|
||||
73565,
|
||||
111899,
|
||||
57543,
|
||||
130314,
|
||||
121605,
|
||||
121426,
|
||||
117143,
|
||||
129957,
|
||||
98042,
|
||||
104760,
|
||||
144846,
|
||||
131238,
|
||||
101076,
|
||||
53328,
|
||||
83592,
|
||||
104077,
|
||||
101952,
|
||||
54137,
|
||||
115363,
|
||||
60556,
|
||||
133086,
|
||||
113361,
|
||||
117829,
|
||||
75003,
|
||||
93729,
|
||||
140022,
|
||||
126219,
|
||||
59907,
|
||||
140589,
|
||||
91812,
|
||||
50485,
|
||||
56232,
|
||||
92858,
|
||||
106820,
|
||||
123423,
|
||||
98553,
|
||||
135315,
|
||||
95583,
|
||||
72278,
|
||||
98702,
|
||||
55709,
|
||||
146773,
|
||||
89719,
|
||||
134752,
|
||||
79562,
|
||||
70455,
|
||||
88468,
|
||||
139824,
|
||||
138646,
|
||||
117516,
|
||||
123267,
|
||||
113754,
|
||||
120353,
|
||||
139145,
|
||||
53219,
|
||||
63053,
|
||||
131434,
|
||||
91705,
|
||||
53650,
|
||||
145234,
|
||||
78461,
|
||||
119587,
|
||||
108976,
|
||||
113613,
|
||||
121790,
|
||||
120366
|
||||
};
|
||||
}
|
||||
}
|
||||
36
ProblemOne/Properties/AssemblyInfo.cs
Normal file
36
ProblemOne/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ProblemOne")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ProblemOne")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("58fece0a-7ac6-47cc-a93a-6d843fc040a0")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
ProblemOne/bin/Debug/ProblemOne.exe
Normal file
BIN
ProblemOne/bin/Debug/ProblemOne.exe
Normal file
Binary file not shown.
6
ProblemOne/bin/Debug/ProblemOne.exe.config
Normal file
6
ProblemOne/bin/Debug/ProblemOne.exe.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
BIN
ProblemOne/bin/Debug/ProblemOne.pdb
Normal file
BIN
ProblemOne/bin/Debug/ProblemOne.pdb
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
32b0cee30476cf404bcb931ca8435e90f1b2fd77
|
||||
@@ -0,0 +1,7 @@
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\bin\Debug\ProblemOne.exe.config
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\bin\Debug\ProblemOne.exe
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\bin\Debug\ProblemOne.pdb
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\obj\Debug\ProblemOne.csprojAssemblyReference.cache
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\obj\Debug\ProblemOne.csproj.CoreCompileInputs.cache
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\obj\Debug\ProblemOne.exe
|
||||
C:\Users\grodriguez\source\repos\AdventOfCode\2019\ProblemOne\ProblemOne\obj\Debug\ProblemOne.pdb
|
||||
BIN
ProblemOne/obj/Debug/ProblemOne.csprojAssemblyReference.cache
Normal file
BIN
ProblemOne/obj/Debug/ProblemOne.csprojAssemblyReference.cache
Normal file
Binary file not shown.
BIN
ProblemOne/obj/Debug/ProblemOne.exe
Normal file
BIN
ProblemOne/obj/Debug/ProblemOne.exe
Normal file
Binary file not shown.
BIN
ProblemOne/obj/Debug/ProblemOne.pdb
Normal file
BIN
ProblemOne/obj/Debug/ProblemOne.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user