14.01.2013 Views

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Explicaciones a <strong>los</strong> <strong>problemas</strong> South American Regionals 2008 26<br />

}<br />

while(scanf("%d %d",&N,&M) == 2 && N)<br />

{<br />

for(i = A = B = 0; i < N; i++)<br />

{<br />

for(j = a = b = 0; j < M; j++)<br />

{<br />

scanf("%d",&c);<br />

c = max(a+c,b);<br />

a = b;<br />

b = c;<br />

}<br />

C = max(A+c,B);<br />

A = B;<br />

B = C;<br />

}<br />

printf("%d\n",C);<br />

}<br />

return(0);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!