#C++ 213 bytes * 0.5 = 106.5 Here is my solution. It's similar to [user2357112's solution][1], but there are several difference: + First, I *dispatch* visiting times to the right and bottom, instead of compute them from the top and left. + Second, I do everything (reading input, dispatching, tracking the man's location) simultaneously. + Third, I keep only one row of memory. <!-- language-all: lang-c++ --> #include <iostream> int o[1001],h,w,r,c,i,j,t,u;int main(){std::cin>>h>>w>>*o;for(;i<h;i++)for(j=0;j<w;)std::cin>>t,u=o[j],o[j]/=2,u%2&&o[j+t]++,r-i|c-j||((u+t)%2?r:c)++,o[++j]+=u/2;std::cout<<r<<" "<<c<<"\n";} Here is the ungolfed version: #include <iostream> using namespace std; int o[1001]; int main(){ int h, w, n; cin >> h >> w >> n; o[0] = n; int r = 0, c = 0; for(int i = 0; i < h; i++) for(int j = 0; j < w; j++){ bool t; cin >> t; int u = o[j]; o[j + 1] += u / 2; o[j] = u / 2; if(u % 2) (t ? o[j + 1] : o[j])++; if(r == i && c == j) ((u + t) % 2 ? r : c)++; } cout << r << " " << c << endl; } [1]: https://codegolf.stackexchange.com/a/25322/15882