### Saratov State University :: Online Contester

::Go
- home
- news
- register
 - update personal info
 - problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- projects

 ::Poll Are you registered on Codeforces?YesNoWhat is it???[results]

::webboard

 Some Problem in C# (to site admins)
Author: Mirzakhmet Syzdykov
ID: 004300
Problem: 196
Contest: 0
Date: 2011-08-14 21:54:59

Hello this is to site admins too:
Why my solution gives memory limit exceeded if I write in C# the following code (please fix it somehow or check my solution):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sgu196
{
class Program
{
static int[] nextInt(string s)
{
int i, k = -1, len = 0;
int[] result = new int[2];
for (i = 0; i < s.Length; ++i)
if ("0123456789".IndexOf(s[i]) >= 0)
{
if (k == -1) k = 0;
k = k * 10 + (int)s[i] - (int)'0';
}
else
{
if (k >= 0) result[len++] = k;
k = -1;
}
if (k >= 0) result[len++] = k;
return result;
}
static void Main(string[] args)
{
int i, n = ret[0], m = ret[1];
int[] deg = new int[n];
int[][] arc = new int[m][];
for (i = 0; i < n; ++i) deg[i] = 0;
for (i = 0; i < m; ++i) {
--arc[i][0]; --arc[i][1];
++deg[arc[i][0]]; ++deg[arc[i][1]];
}
int result = 0;
for (i = 0; i < m; i++)
result += deg[arc[i][0]] + deg[arc[i][1]];
Console.WriteLine(result.ToString());
}
}
}