46522023-03-30 14:29:38Leventusz19Váltakozó (75 pont)csharpWrong answer 0/75583ms32800 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Váltakozó_szöveg{
    class Program{
        static void Main(){
            string in1 = Console.ReadLine();
            char[] c = in1.ToArray();
            bool[] cc = new bool[c.Length];
            string abc = "abcdefghijklmnopqrtsuvwxyz";
            string o1 = "";
            Array.Sort(c);
            for(int i=0, j=0, lj=0; i<c.Length; i++){
                j = i;
                lj = j;
                var ij = false;
                while (i > 0 && o1[i - 1] == c[j] && !cc[j]) if (j == lj && ij) { Console.WriteLine(-1); Console.ReadKey(); return; } else if (!cc[j] && j < c.Length - 1) j++; else if (j == 0) ij = true;else  j=0;
                //while(c[j]==o1[i-1])
                o1 += c[j];
                //Console.Write(o1[i]);
            }
            Console.WriteLine(o1);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/029ms21120 KiB
2Wrong answer0/032ms23828 KiB
3Wrong answer0/329ms21508 KiB
4Wrong answer0/329ms22192 KiB
5Wrong answer0/328ms22272 KiB
6Wrong answer0/328ms23112 KiB
7Time limit exceeded0/3551ms30580 KiB
8Time limit exceeded0/3546ms9788 KiB
9Time limit exceeded0/3561ms9944 KiB
10Time limit exceeded0/3550ms9780 KiB
11Wrong answer0/335ms32176 KiB
12Wrong answer0/337ms32252 KiB
13Wrong answer0/335ms32072 KiB
14Wrong answer0/339ms32208 KiB
15Time limit exceeded0/3573ms31520 KiB
16Time limit exceeded0/3579ms31424 KiB
17Time limit exceeded0/3575ms31964 KiB
18Time limit exceeded0/3555ms31944 KiB
19Time limit exceeded0/3579ms32332 KiB
20Time limit exceeded0/3549ms32256 KiB
21Time limit exceeded0/3583ms32420 KiB
22Time limit exceeded0/6552ms32764 KiB
23Time limit exceeded0/6552ms32528 KiB
24Time limit exceeded0/6556ms32800 KiB