Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kira Akcija C# 0/100Napaka med izvajanjem / ob izhodu (RTE) 20. apr '17 @ 17:51

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 21,383 MiB 0,000 s OK
#2 7/7 19,367 MiB 0,000 s OK
#3 7/7 21,332 MiB 0,000 s OK
#4 0/7 20,887 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fc37eaa3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41957b00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fc37eaa3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41957b00 + 0x0030c> in <filename unknown>:0 
#5 0/8 20,648 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f6a99a2b770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x4072fb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f6a99a2b770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x4072fb00 + 0x0030c> in <filename unknown>:0 
#6 0/8 20,871 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f84b66a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41ddeb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f84b66a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41ddeb00 + 0x0030c> in <filename unknown>:0 
#7 0/8 20,930 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fa670ea3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x40957b00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fa670ea3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x40957b00 + 0x0030c> in <filename unknown>:0 
#8 0/8 18,984 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fc1da2a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x4115cb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7fc1da2a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x4115cb00 + 0x0030c> in <filename unknown>:0 
#9 0/8 20,941 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f609362b770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x415afb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f609362b770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x415afb00 + 0x0030c> in <filename unknown>:0 
#10 0/8 20,973 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f174eea3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x40879b00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f174eea3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x40879b00 + 0x0030c> in <filename unknown>:0 
#11 0/8 20,977 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f2b0b2a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41bbbb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f2b0b2a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x41bbbb00 + 0x0030c> in <filename unknown>:0 
#12 0/8 20,996 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f4b6a6a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x412dbb00 + 0x0030c> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (System.Collections.Generic.TKey key) <0x7f4b6a6a3770 + 0x0004f> 23611 in <filename unknown>:0 
  at Akcija.Program.Main (System.String[] args) <0x412dbb00 + 0x0030c> in <filename unknown>:0 
#13 8/8 19,336 MiB 0,000 s OK

Ocenjevani program (Program.cs):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akcija
{
    class Program
    {

        static int today = 109;
        static Dictionary<string, int> months = new Dictionary<string, int>();
        static void Main(string[] args)
        {
            //set beggining days
            months.Add("januar",-1);
            months.Add("februar",30);
            months.Add("marec",58);
            months.Add("april",89);
            months.Add("maj",119);
            months.Add("junij",150);
            months.Add("julij",180);
            months.Add("avgust",211);
            months.Add("september",242);
            months.Add("oktober", 272);
            months.Add("november", 303);
            months.Add("decmeber", 333);
            //parse input
            int loop = Int32.Parse(Console.ReadLine());
            for (int example = 0; example < loop; example++)
            {
                //parse input
                string[] polje = Console.ReadLine().Split();
                //remove . from day
                polje[2] = polje[2].Substring(0, polje[2].Length - 1);
                //calculate day diffrence
                int input_day = months[polje[3]] + Int32.Parse(polje[2]);
                int diffrence_day = input_day - today;
                if (diffrence_day < 0)
                {
                    Console.WriteLine("V SMETI");
                }
                else
                {
                    int storage = Int32.Parse(polje[0]);
                    double max_sell = Convert.ToDouble(polje[1], System.Globalization.CultureInfo.InvariantCulture) * (diffrence_day + 1);
                    if (storage > max_sell) { Console.WriteLine("AKCIJA"); }
                    else { Console.WriteLine("OK"); }
                }
            }
        }
    }
}