93812024-02-21 11:27:56Leventusz09Táblajáték 2 (70 pont)csharpWrong answer 0/7035ms26636 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);
            }
            int o2 = int.Parse(o1);

            Console.WriteLine("{0}\n{1}", o2.ToString().Length ,o2);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/70
1Wrong answer0/034ms22340 KiB
2Runtime error0/034ms22024 KiB
3Wrong answer0/230ms22748 KiB
4Runtime error0/334ms22944 KiB
5Wrong answer0/332ms24248 KiB
6Runtime error0/335ms23876 KiB
7Runtime error0/334ms24028 KiB
8Runtime error0/332ms24076 KiB
9Runtime error0/335ms24612 KiB
10Runtime error0/335ms24828 KiB
11Runtime error0/332ms24964 KiB
12Runtime error0/335ms25344 KiB
13Runtime error0/335ms25052 KiB
14Runtime error0/335ms25152 KiB
15Runtime error0/435ms25200 KiB
16Runtime error0/435ms25572 KiB
17Runtime error0/434ms25956 KiB
18Runtime error0/435ms25860 KiB
19Runtime error0/434ms26536 KiB
20Runtime error0/432ms26636 KiB
21Runtime error0/434ms26384 KiB
22Runtime error0/432ms26244 KiB
23Runtime error0/335ms26128 KiB