93832024-02-21 11:28:34Leventusz09Táblajáték 2 (70 pont)csharpRuntime error 3/7035ms26264 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";

            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
base3/70
1Accepted0/030ms22104 KiB
2Runtime error0/032ms22068 KiB
3Partially correct1/230ms22848 KiB
4Runtime error0/332ms22524 KiB
5Partially correct2/330ms23380 KiB
6Runtime error0/335ms23056 KiB
7Runtime error0/335ms23236 KiB
8Runtime error0/334ms24264 KiB
9Runtime error0/334ms24652 KiB
10Runtime error0/334ms24332 KiB
11Runtime error0/335ms24444 KiB
12Runtime error0/334ms24840 KiB
13Runtime error0/334ms24792 KiB
14Runtime error0/335ms24888 KiB
15Runtime error0/434ms25096 KiB
16Runtime error0/434ms25572 KiB
17Runtime error0/434ms25452 KiB
18Runtime error0/434ms25752 KiB
19Runtime error0/432ms25776 KiB
20Runtime error0/432ms26088 KiB
21Runtime error0/432ms25660 KiB
22Runtime error0/432ms26264 KiB
23Runtime error0/332ms26084 KiB