|
|
@ -85,7 +85,7 @@ std::vector<std::vector<Blizzard>> getBoard(int minute){ |
|
|
|
|
|
|
|
|
|
|
|
int main() |
|
|
|
int main() |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::ifstream file("smallinput"); |
|
|
|
std::ifstream file("testinput"); |
|
|
|
std::vector<std::vector<Blizzard>>board; |
|
|
|
std::vector<std::vector<Blizzard>>board; |
|
|
|
while (file.good()){ |
|
|
|
while (file.good()){ |
|
|
|
std::string line; |
|
|
|
std::string line; |
|
|
@ -143,7 +143,7 @@ int main() |
|
|
|
for (int y=0;y<board.size();y++){ |
|
|
|
for (int y=0;y<board.size();y++){ |
|
|
|
int prevBlizzard=-1; |
|
|
|
int prevBlizzard=-1; |
|
|
|
std::vector<Blizzard>sorted=board[y]; |
|
|
|
std::vector<Blizzard>sorted=board[y]; |
|
|
|
std::sort(sorted.begin(),sorted.end(),[](Blizzard&b1,Blizzard&b2){return b1.pos.x<b2.pos.y;}); |
|
|
|
std::sort(sorted.begin(),sorted.end(),[](Blizzard&b1,Blizzard&b2){return b1.pos.x<b2.pos.x;}); |
|
|
|
for (int x=0;x<sorted.size();x++){ |
|
|
|
for (int x=0;x<sorted.size();x++){ |
|
|
|
Blizzard&b=sorted[x]; |
|
|
|
Blizzard&b=sorted[x]; |
|
|
|
for (int k=prevBlizzard;k<b.pos.x-1;k++){ |
|
|
|
for (int k=prevBlizzard;k<b.pos.x-1;k++){ |
|
|
|