<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<!-- DOMjudge version 3.3.2 -->
<title>Source: s653</title>
<link rel="shortcut icon" href="../images/favicon.png" type="image/png" />
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="stylesheet" href="style_jury.css" type="text/css" />
<script type="text/javascript" src="../js/sorttable.js"></script>
<script type="text/javascript" src="../js/domjudge.js"></script>
</head>
<body>

<h2>Source code for submission s653</h2>

<p><a href="#diff">Go to diff to previous submission</a></p>

<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="source0"></a>grasshop.cpp</h2> 

<pre class="cpp" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;stdio.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;limits.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;iostream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> <span style="color: #000040;">**</span> ARRAY<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> SIZEX<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> SIZEY<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> MINCOUNT<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> leafx, leafy<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">/*</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">int min(int &amp; X, int &amp; Y)</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">{</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">	if(X&gt;Y) return Y;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">	else return X;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">}</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff0000; font-style: italic;">*/</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">void</span> jump<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> X, <span style="color: #0000ff;">int</span> Y, <span style="color: #0000ff;">int</span> count<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>X<span style="color: #000080;">==</span><span style="color: #008000;">&#40;</span>leafx<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;&amp;</span> Y<span style="color: #000080;">==</span><span style="color: #008000;">&#40;</span>leafy<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>count <span style="color: #000080;">&lt;</span> MINCOUNT<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		ARRAY<span style="color: #008000;">&#91;</span>X<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>Y<span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span>count<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		MINCOUNT<span style="color: #000080;">=</span>count<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">return</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>X<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">0</span> <span style="color: #000040;">||</span> X<span style="color: #000080;">&gt;=</span>SIZEX <span style="color: #000040;">||</span> Y<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">0</span> <span style="color: #000040;">||</span> Y<span style="color: #000080;">&gt;=</span>SIZEY <span style="color: #000040;">||</span> count <span style="color: #000080;">&gt;=</span> ARRAY<span style="color: #008000;">&#91;</span>X<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>Y<span style="color: #008000;">&#93;</span> <span style="color: #000040;">||</span> count<span style="color: #000080;">&gt;=</span>MINCOUNT<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">return</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ARRAY<span style="color: #008000;">&#91;</span>X<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>Y<span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span>count<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span>,Y<span style="color: #000040;">+</span><span style="color: #0000dd;">2</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">+</span><span style="color: #0000dd;">2</span>,Y<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">+</span><span style="color: #0000dd;">2</span>,Y<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span>,Y<span style="color: #000040;">-</span><span style="color: #0000dd;">2</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>,Y<span style="color: #000040;">-</span><span style="color: #0000dd;">2</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">-</span><span style="color: #0000dd;">2</span>,Y<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">-</span><span style="color: #0000dd;">2</span>,Y<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">jump<span style="color: #008000;">&#40;</span>X<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>,Y<span style="color: #000040;">+</span><span style="color: #0000dd;">2</span>, count<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">int</span> grex, grey<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">scanf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;%d %d %d %d %d %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #000040;">&amp;</span>SIZEX, <span style="color: #000040;">&amp;</span>SIZEY, <span style="color: #000040;">&amp;</span>grex, <span style="color: #000040;">&amp;</span>grey,  <span style="color: #000040;">&amp;</span>leafx, <span style="color: #000040;">&amp;</span>leafy<span style="color: #008000;">&#41;</span><span style="color: #000080;">==</span><span style="color: #0000dd;">6</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		MINCOUNT<span style="color: #000080;">=</span><span style="color: #0000ff;">INT_MAX</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		ARRAY<span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> <span style="color: #0000ff;">int</span> <span style="color: #000040;">*</span><span style="color: #008000;">&#91;</span>SIZEX<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>SIZEX<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			ARRAY<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #0000dd;">new</span> <span style="color: #0000ff;">int</span> <span style="color: #008000;">&#91;</span>SIZEY<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> j<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> j<span style="color: #000080;">&lt;</span>SIZEY<span style="color: #008080;">;</span> j<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">				ARRAY<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>j<span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #0000ff;">INT_MAX</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #008000;">&#125;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		jump<span style="color: #008000;">&#40;</span>grex<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>,grey<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span>,<span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>ARRAY<span style="color: #008000;">&#91;</span>leafx<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>leafy<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #000080;">==</span><span style="color: #0000ff;">INT_MAX</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;impossible<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0000ff;">else</span> <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, ARRAY<span style="color: #008000;">&#91;</span>leafx<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>leafy<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>	</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></div></div><h2><a name="diff"></a>Diff to submission <a href="621">s621</a></h2>
<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="diff"></a>grasshop.cpp</h2>

<pre class="output_text"><span class='diff-del'>--- c4.s621.cteam009.grasshop.cpp.0.grasshop.cpp</span>
<span class='diff-add'>+++ c4.s653.cteam009.grasshop.cpp.0.grasshop.cpp</span>
@@ -1,13 +1,33 @@
 #include &lt;stdio.h&gt;
 #include &lt;limits.h&gt;
<span class='diff-add'>+#include &lt;iostream&gt;</span>
 
 int ** ARRAY;
 int SIZEX;
 int SIZEY;
<span class='diff-del'>-</span>
<span class='diff-add'>+int MINCOUNT;</span>
<span class='diff-add'>+int leafx, leafy;</span>
<span class='diff-add'>+/*</span>
<span class='diff-add'>+int min(int &amp; X, int &amp; Y)</span>
<span class='diff-add'>+{</span>
<span class='diff-add'>+        if(X&gt;Y) return Y;</span>
<span class='diff-add'>+        else return X;</span>
<span class='diff-add'>+}</span>
<span class='diff-add'>+*/</span>
 void jump(int X, int Y, int count)
 {
<span class='diff-del'>-if(X&lt;0 || X&gt;=SIZEX || Y&lt;0 || Y&gt;=SIZEY || count &gt;= ARRAY[X][Y])</span>
<span class='diff-add'>+if(X==(leafx-1) &amp;&amp; Y==(leafy-1))</span>
<span class='diff-add'>+{</span>
<span class='diff-add'>+        if(count &lt; MINCOUNT)</span>
<span class='diff-add'>+        {</span>
<span class='diff-add'>+                ARRAY[X][Y]=count;</span>
<span class='diff-add'>+                MINCOUNT=count;</span>
<span class='diff-add'>+        }</span>
<span class='diff-add'>+        return;</span>
<span class='diff-add'>+}</span>
<span class='diff-add'>+</span>
<span class='diff-add'>+if(X&lt;0 || X&gt;=SIZEX || Y&lt;0 || Y&gt;=SIZEY || count &gt;= ARRAY[X][Y] || count&gt;=MINCOUNT)</span>
 return;
<span class='diff-add'>+</span>
 ARRAY[X][Y]=count;
 
@@ -25,8 +45,9 @@
 int main()
 {
<span class='diff-del'>-        int grex, grey, leafx, leafy;</span>
<span class='diff-add'>+        int grex, grey;</span>
 
         while(scanf(&quot;%d %d %d %d %d %d\n&quot;, &amp;SIZEX, &amp;SIZEY, &amp;grex, &amp;grey,  &amp;leafx, &amp;leafy)==6)
         {
<span class='diff-add'>+                MINCOUNT=INT_MAX;</span>
                 ARRAY=new int *[SIZEX];
                 for (int i=0; i&lt;SIZEX; i++) 
</pre>

</div></div>
</body>
</html>
