aboutsummaryrefslogtreecommitdiffstats
path: root/876/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--876/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/876/main.cpp b/876/main.cpp
index e9a9288..20d49ad 100644
--- a/876/main.cpp
+++ b/876/main.cpp
@@ -19,10 +19,11 @@ public:
heads.push_back(head);
head = head->next;
}
+ heads.push_back(head);
int size = heads.size();
std::cout << "size:" << size << "\n";
- return heads[(size / 2) - ((size - 1) % 2) + 1];
+ return heads[int(size / 2)];
}
};