hiho week 39 register

Ended

Participants:2159

Verdict:Time Limit Exceeded
Score:40 / 100
Submitted:2015-04-03 16:23:32

Lang:C#

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<int,int> valueDict = new Dictionary<int, int>();
            int n = Convert.ToInt32(Console.ReadLine());        //
            string[] line = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                int input = Convert.ToInt32(line[i]);
                valueDict.Add(i,input);
            }
            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = i+1 ; j < n; j++)
                {
                    if (valueDict[i]>valueDict[j])
                    {
                        count++;
                    }
                }
            }
            Console.WriteLine(count);
           Console.ReadKey();
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX