Added older advents
This commit is contained in:
parent
8db2505049
commit
9cf858b860
78 changed files with 13807 additions and 0 deletions
24
advent_of_code_2015/day4/main1.cc
Normal file
24
advent_of_code_2015/day4/main1.cc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "md5.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
string prefix = "bgvyzdsv";
|
||||
|
||||
for (size_t idx = 0; ; ++idx)
|
||||
{
|
||||
string test = prefix + to_string(idx);
|
||||
|
||||
string hash = md5(test);
|
||||
if (hash.find_first_not_of('0') == 6) //5 for solution 1
|
||||
{
|
||||
cout << test << "\n";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue