93792024-02-21 11:26:14Leventusz09Táblajáték 2 (70 pont)csharpWrong answer 0/7032ms24720 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Táblajáték_2{
    class Program{
        static void Main(){
            int K = int.Parse(Console.ReadLine());
            int[] S = Console.ReadLine().Split().Select(int.Parse).ToArray();

            string o1 = "0";
            Console.WriteLine(o1.Substring(0, o1.Length-1));

            for(int i=0, l; i<K; i++){
                l = o1.Length;
                if (S[i] == 0) o1 += "0";
                else if (S[i] == 1) o1 += "1";
                else if (S[i] == 2) o1 += "2";
                else if (S[i] == 3) o1 = o1.Substring(0, l - 1);
                else if (S[i] == 4) if (o1[l - 1] == '0') o1 = o1.Substring(0, l - 2) + (int.Parse(o1[l - 1] + "") - 1) + "2"; else o1 = o1.Substring(0, l - 1) + (int.Parse(o1[l - 1] + "") - 1);
                else if (o1[l - 1] == '2') o1 = o1.Substring(0, l - 2) + (int.Parse(o1[l - 2] + "") + 1) + "0"; else o1 = o1.Substring(0, l - 1) + (int.Parse(o1[l - 1] + "") + 1);
            }

            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/70
1Wrong answer0/030ms22180 KiB
2Runtime error0/032ms21992 KiB
3Wrong answer0/229ms22952 KiB
4Wrong answer0/329ms22924 KiB
5Wrong answer0/329ms23120 KiB
6Wrong answer0/330ms23516 KiB
7Wrong answer0/330ms24140 KiB
8Runtime error0/332ms23508 KiB
9Wrong answer0/329ms23596 KiB
10Wrong answer0/329ms24104 KiB
11Wrong answer0/329ms23940 KiB
12Wrong answer0/329ms24152 KiB
13Runtime error0/332ms23176 KiB
14Wrong answer0/330ms24128 KiB
15Wrong answer0/429ms24332 KiB
16Wrong answer0/430ms24592 KiB
17Wrong answer0/429ms24324 KiB
18Wrong answer0/429ms24432 KiB
19Wrong answer0/430ms24388 KiB
20Wrong answer0/429ms24620 KiB
21Wrong answer0/429ms24324 KiB
22Wrong answer0/430ms24544 KiB
23Wrong answer0/330ms24720 KiB